Example #1
0
        /// <summary>
        /// Re-applies the bounds to the internal animation object, and the relevant renderable object if one exists.
        /// </summary>
        internal void UpdateBounds(bool updateRenderable = true)
        {
            NativeRenderable renderable = null;

            if (updateRenderable && animatedRenderable != null)
            {
                renderable = animatedRenderable.Native;
            }

            if (serializableData.useBounds)
            {
                if (renderable != null)
                {
                    renderable.UseOverrideBounds = true;
                    renderable.OverrideBounds    = serializableData.bounds;
                }

                if (_native != null)
                {
                    AABox bounds = serializableData.bounds;
                    bounds.TransformAffine(SceneObject.WorldTransform);

                    _native.Bounds = bounds;
                }
            }
            else
            {
                if (renderable != null)
                {
                    renderable.UseOverrideBounds = false;
                }

                if (_native != null)
                {
                    AABox bounds = new AABox();
                    if (animatedRenderable != null)
                    {
                        bounds = animatedRenderable.Bounds.Box;
                    }

                    _native.Bounds = bounds;
                }
            }
        }
Example #2
0
        private void OnReset()
        {
            if (_native != null)
            {
                _native.OnDestroy();
            }

            _native = new NativeRenderable(SceneObject);

            // Restore saved values after reset
            _native.Mesh = serializableData.mesh;

            if (serializableData.materials != null)
            {
                _native.Materials = serializableData.materials;
            }

            _native.Layers = serializableData.layers;
        }
Example #3
0
 private static extern void Internal_Create(NativeRenderable instance, IntPtr parentSO);
Example #4
0
 private static extern void Internal_Create(NativeRenderable instance, IntPtr parentSO);
Example #5
0
        private void OnReset()
        {
            if (_native != null)
                _native.OnDestroy();

            _native = new NativeRenderable(SceneObject);

            // Restore saved values after reset
            _native.Mesh = serializableData.mesh;

            if (serializableData.materials != null)
                _native.Materials = serializableData.materials;

            _native.Layers = serializableData.layers;
        }