Пример #1
0
 public Node <TEntity> CreateNode(Node <TEntity> parent, TEntity entity, LocalTransform localTransform)
 {
     return(new Node <TEntity>(this, localTransform, (localTransform != null)?new WorldTransform():null, entity)
     {
         Parent = parent
     });
 }
Пример #2
0
 public void CopyFrom(LocalTransform other)
 {
     _flags = other._flags;
     if (0 == (_flags & Flags.InvalidMatrix))
     {
         _matrix = other._matrix;
     }
     if (0 == (_flags & Flags.InvalidPRS))
     {
         _position = other._position;
         _rotation = other._rotation;
         _scale    = other._scale;
     }
 }
Пример #3
0
        public Node(Scene <TEntity> scene, LocalTransform localTransform, WorldTransform worldTransform, TEntity entity)
        {
            //TODO: Make Node constructor internal
            _scene              = scene;
            _entity             = entity;
            Transform           = localTransform;
            Transform.OnUpdate += HandleTransformUpdate;

            WorldTransform             = worldTransform;
            WorldTransform.WorldMatrix = Matrix4x4.Identity;

            AddTo(this, scene);

            InvalidateWorldTransform();
        }