예제 #1
0
        public SetupInstance(uint setupID)
        {
            Setup = SetupCache.Get(setupID);

            Position = Vector3.Zero;
            Rotation = Quaternion.Identity;
            Scale    = Vector3.One;

            BuildWorldTransform();
        }
예제 #2
0
        public SetupInstance(R_PhysicsObj obj)
        {
            var setupID = obj.PhysicsObj.PartArray.Setup._dat.Id;

            if (setupID == 0 && obj.PhysicsObj.PartArray.Parts.Count > 0)
            {
                setupID = obj.PhysicsObj.PartArray.Parts[0].GfxObj.ID;
            }

            if (setupID == 0)
            {
                setupID = obj.PhysicsObj.ID;
            }

            Setup = SetupCache.Get(setupID);

            Position = obj.PhysicsObj.Position.Frame.Origin.ToXna();
            Rotation = obj.PhysicsObj.Position.Frame.Orientation.ToXna();
            Scale    = obj.PhysicsObj.PartArray.Scale.ToXna();

            BuildWorldTransform();
        }