io.extendreality.zinnia.unity
Advanced tools
Changelog
1.26.0 (2020-12-12)
The ConstantVelocityTracker returns the velocity data as set on its properties.
The RigidbodyVelocityTracker returns the velocity data from a rigidbody.
Extracted ArtificialVelocityApplierProcess to allow the component to process in chosen moment. Added convenient methods IncrementVelocity() and IncrementAngularVelocity(). Use Vector3.Lerp() instead of Slerp() to calculate drag. ArtificialVelocityApplier is derived from this new process and maintains its current behaviour to process using coroutine.
Extracted AverageVelocityEstimatorProcess to allow the component to process in chosen moment. AverageVelocityEstimator is derived from this new process and maintains its current behaviour to process using LateUpdate().
Changelog
1.25.1 (2020-10-26)
The RigidbodyAngularVelocity component was calculating the angle of angular velocity in degrees but angular velocity is set in radians so this was causing artifacts when rotating.
The fix is to ensure the angle is calculated in radians.
Co-authored-by: JGroxz
Changelog
1.25.0 (2020-10-02)
The LinkedAliasAssociationCollection now has the concept of haptic profiles for the left and right controller.
The haptic profile is a list of haptice processes for each controller that describe different haptic output scenarios.
Changelog
1.24.0 (2020-08-29)
The new TargetPointValidity rule allows a type of Vector3Rule to be used to determine if the located point of the RayCast in the SurfaceLocator should be considered a valid target.
This can be used with the NavMeshRule to determine if a point on a surface is within the NavMesh boundaries.
The stub Vector3 rule has been moved out of the StraightLineCastTest and into its own stub so it can be used in multiple places. This is instead of testing with the actual NavMeshRule.
A number of aggregate functions for float collections have been added to return common aggregates such as:
- Mean * Median * Mode * Min * Max * Range
The UseLocal setting was not returning data that made sense. The
UseLocal = false
was just returning the world direction Vector which had nothing to do with theSource
so it made little sense to have it part of the TransformDirectionExtractor.The
UseLocal = true
setting was actually returning the world direction of theSource
so this is now theUseLocal = false
operation asSource.transform.forward
is actually the world forward direction of theSource
even if it is a nested GameObject with multiple parent rotations.This means the
UseLocal = true
setting is now the local direction of theSource
GameObject so if it is a nested child with an additional parent rotation then the local forward is purely the local rotation of the GameObject multiplied by the world forward constant (Vector3.forward).Whilst this will introduce a breaking change, it's actually a fix for operations that were not correct, so it's not a feature including breaking changes, it's actually fixing inaccurate behaviour.
The RotateAroundAngularVelocity was using the rotate axis as the current target rotation multiplied by the target direction which will only work if the target isn't rotated. It only needs to rotate around the target direction as this is already taking rotation of the target into consideration.
Changelog
1.23.0 (2020-08-15)
The new TargetPointValidity rule allows a type of Vector3Rule to be used to determine if the PointsCast target point should be considered as a valid target.
This can be used with the new NavMeshRule to determine if a target point from the points cast is within the NavMesh boundaries.
The NavMeshRule extends the new Vector3Rule which determines if a given Vector3 point is within the limits of a NavMesh.
Changelog
1.22.0 (2020-08-13)
The ActiveCollisionRegisteredConsumerContainer is linked to a ActiveCollisionPublisher and its job is to store a collection of consumers that the publisher has successfully published to.
This means the publisher still doesn't know directly who it is publishing to, but holds an audit log of which consumers have successfully received the payload in the past.
The ActiveCollisionConsumer now also holds a reference to the top level container (i.e. the colliding rigidbody/collider GameObject) that the component is residing under.
Changelog
1.21.0 (2020-07-28)
A collection of extractors that can extract specific data from the ObjectFollower.EventData.
For example, an Interactable is using Follow Rigidbody. When it is diverged, the event data can be feed into the ObjectFollowerEventDataSourceExtractor to get the grabbing interactor.
The MomentProcessor can now process moments in the Unity
BeforeRender
game loop moment.
There is an issue when an object is released on its diverged state, the state is not removed when it converges. The leftover state causes the object not be able to converge and diverge again.
There is an issue when using XRNodeVelocityEstimator on controllers, if the play area is rotated 180 degrees, throwing an interactable forward will cause it to be thrown backward.
The solution is to also consider the velocities relative to the play area.
Changelog
1.20.0 (2020-07-11)
The new InitialValue property allows an Action to have the starting value set in the Unity Editor at edit time. Once the script is started then the InitialValue will be used to set the default state of the Action (but no events will be emitted to denote an action change as technically the state hasn't changed if it is moving to the initial state).
This new InitialValue property is only for use in the UnityEditor at Edit time and cannot be changed at runtime nor can it be set via script. If an initial value is required via creation of an Action by script then simply just need to create the Action and call
Receive(<your-initial-value>)
prior to any event listeners being hooked up. This will simply call theReceive
method and will emit the relevant events, but as no event listeners should have been registered then this won't make any difference.An extra method of
ReceiveInitialValue
has also been added that will allow theReceive
method to be called with the initial set value. Again, this is only useful for when creating the Action via the Unity Inspector as the InitialValue cannot be changed via script.The
DefaultValue
help text has also been updated to make it more clearer what this property is for as it's not the starting value of the Action, but the value the Action needs to be at to be considered disabled.
A couple of new Enum helper methods have been added that make getting an enum easier by either being able to provide the index of the enum to return or by getting the enum by string name.
The PointerElementPropertyMutator has been updated to take advantage of this new method.
A common calculation is finding a fine grain distance between two points (either Vector2 or Vector3) where the tolerance is also given in the same type as opposed to just a simple
float
.The new Vector2.WithinDistance and Vector3.WithinDistance offer this via the relevant extensions.
Another common calculation is converting euler degrees to signed degrees, such as 270' is actually equivalent to -90'. This helps when doing greater than or less than comparisons as a negative rotation of -90' is less than a rotation of 0' whereas 270' as a number would be greater than 0'.
The
Vector3.UnsignedEulerToSignedEuler
will convert the current Vector3 of euler angles into a Signed Euler (-180' to 180f) using the newfloat.GetSignedDegree
which simply converts a Euler angle into the -180' to 180' range.These are then used to provide new Transform extensions for:
Transform.SignedEulerAngles
*Transform.SignedLocalEulerAngles
Which simply return the respective Euler or Local Euler angle for the Transform but in this signed format.
Some property types cannot be changed via UnityEvents as they are not supported in the UnityEvent inspector, such as Enums, Vectors and Vector3State.
This has been fixed by adding custom setter methods that can be called via the UnityEvent inspector using primitive types that are supported to allow this data to still be set.
A new Property Modifier type known as a Divergable Property Modifier has been added that allows a property modifier to know when the target has become diverged from the source in whatever property it is tracking.
Only certain types of modifier can actually ever cause a divergence, such as the RigidbodyVelocity and RigidbodyAngularVelocity because they can make it so the target is not keeping exactly up to date with the source and become diverged somewhat.
So now both RigidbodyVelocity and RigidbodyAngularVelocity have become extensions of the DivergablePropertyModifier and now emit events when the source/target diverge and converge again.
It is also possible to turn off this divergence tracking and it is turned off by default as it adds an additional overhead, which should not be automatically implemented unless the overhead is warranted for the benefits of using the functionality.
The ObjectFollower.EventData can now be proxied via the new ObjectFollowerEventProxyEmitter and this data can also now be used as an input to the PropertyModifier
Modify
method as this makes it easy to chain Property Modifiers together to have one modifier use its data to call another Property Modifier.
The new Yield events provide the ability to trigger some action after a yield instruction has completed such as seconds passed or at end of frame.
This can be used in conjunction with the Proxy events to first store the payload in the Proxy then trigger the emit after the yield instruction has completed.
There is an issue where the MinMaxRange control will reset the value back to the previous value when it is used within a prefab.
The solution seems to be to record the prefab instance property modification after the custom FloatRange value has been set through the Supyrb
SetValue
extension, which doesn't set the value via the SerializedProperty because that is not supported in Unity on custom data types.The issue only seems to present itself when changing the value between varying negative values:
- -0.5 * -0.2 * -0.5 (reverts to 0)
The coding guidelines state that empty classes should have the brackets on the same line as such:
class { }
and not
class { }
This has now been applied to the relevant offending files.
Changelog
1.19.0 (2020-06-07)
The TransformPositionMutator has a Facing Direction offset that can be provided which is used to offset the forward direction based on the rotation of this optional offset GameObject. It is now possible to determine which axes of that offset should be used when utilizing the rotation data as there are occurrences where not all of the offset rotations are wanted.
The TransformEulerRotationMutator has an Origin offset that can be used to rotate around a different pivot point position. It is now possible to determine which axes of direction should be used from the optional pivot point as sometimes not all axes may be required.
The SourceTargetProcessor now emits an event when the ActiveSource being used for the process changes. It also emits the initial value as ActiveSource starts as
null
and when it is first enabled and called then ActiveSource will be changed fromnull
and therefore it will emit the event.
The Cache operations have been deprecated but the tests still actively use the components to test them and therefore throws warning messages about the use of deprecated components.
It's right to keep the tests but just suppress the warnings.
Changelog
1.18.0 (2020-05-31)
The new ObservableProperty types allow a data type property to be set in the inspector but any change to that property is observed and an appropriate event is raised for the state of the property.
This is a better implementation of the ValueCache components which didn't really offer much other than storing a value via code and raising events when that value was modified. The ValueCache components have now been deprecated with the new ObservableProperty counterparts being a much better choice.
The Payload property on the Event Proxy has now been exposed as a serialized public property so it can be set via the inspector or via external code or Unity event. This payload can then be emitted at a later stage by calling the existing
EmitPayload
method.There is also a
ClearPayload
method for setting the Payload property back to thedefault
value.
The new RotateAroundAngularVelocity component will modify a target's rotation property by rotating around the offset using the angular velocity of the given VelocityTracker as the angles in which to rotate per frame.
This can be used to simulate turning something with the rotation of the controller, such as screwing in a screw.
The property order has been re-arranged so the properties are not split by the events when the concrete classes add more properties and headers have been added to make the split clearer.