EveTriggerVolume implementation - #69
Open
phevosccp wants to merge 14 commits into
Open
Conversation
Stop unregistered the updateable but kept the action's reference to the emitter, so the emitter outlived the action that was driving it.
Volumes gain a persisted enabled attribute, so a placement can switch between trigger shapes without editing the shape list, and a name accessor so per-placement names can be read back off a volume. Implemented for the box, sphere and ellipsoid shapes. Only EveTriggerVolume honours the flag so far: fog volumes, post process volumes, lighting overrides, procedural containers and distribution placement generators still evaluate every volume they are given.
A top-level scene object whose trigger region is a list of IEveVolume shapes placed relative to its own translation and rotation, editable in Graphite like any other space object. Each synchronous update it evaluates the tracked position against the enabled volumes and keeps the inside/outside state, exposed read-only as isInside and intensity. A local bounding sphere over the enabled volumes acts as the broad phase for the point test and provides the bounds for picking, falling back to a unit radius so an object with no volumes set up yet stays selectable.
SetCallback stores a Python callable that is invoked as callback( name, entered ) whenever the tracked position crosses the threshold. Transitions are detected during update, so the call is deferred to the post-update point on the main thread; the object is locked while the callback is queued and unlocked once it has run, so it cannot be destroyed in between.
The highest intensity among the exclusion volumes is subtracted from the trigger intensity and clamped at zero, so a region can have holes in it without modelling the remainder as separate shapes.
Draws the trigger volumes - green while the tracked position is inside, white otherwise - the exclusion volumes in red, and the broad-phase bounding sphere, each under its own debug option. forceTriggered pins the trigger into the entered state so a setup can be exercised in Graphite with no ball attached.
External parameters expose per-placement values for dungeon asset manipulations, and the translation/rotation curve slots let the client attach the object's own destiny ball instead of driving the object from the static translation and rotation attributes. The callback name now prefers the first enabled volume's name: external parameters in a .red file cannot reference the root object, so per-placement names are bound to a volume, and the client overwrites the root name attribute with the destiny ball ID when adding the object to the scene.
- some docs fixes
- documentation fixes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
EVETriggerVolumesimply triggers a Python callback when a tracked position crosses into or out of a volume region.When authoring a trigger volume in Graphite you will see more options (e.g trigger a Node graph) but these don't directly affect trinity.
gTriDev->AddPostUpdateCallbackwith the objectLock()ed, soPython is only touched at post-update on the main thread , similar to what
TriEventCurvedoes.EveBoxVolume/EveSphereVolume/EveEllipsoidVolumethrough theIEveVolumeinterface.
IEveSpaceObject2,IWorldPosition,IInitializeandITr2DebugRenderable.Testing
Tested for Frontier, the volume authoring code changes will be a separate PR for platformtools together with monolith changes.
In the demo volumes will trigger 3 custom callbacks:
demo.mp4