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 }); }
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; } }
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(); }