Ejemplo n.º 1
0
        public static PartArray CreateMesh(PhysicsObj owner, uint setupDID)
        {
            var mesh = new PartArray();

            mesh.Owner = owner;
            mesh.Sequence.SetObject(owner);
            if (!mesh.SetMeshID(setupDID))
            {
                return(null);
            }
            mesh.SetPlacementFrame(0x65);
            return(mesh);
        }
Ejemplo n.º 2
0
        public static PartArray CreateSetup(PhysicsObj owner, uint setupDID, bool createParts)
        {
            var setup = new PartArray();

            setup.Owner = owner;
            setup.Sequence.SetObject(owner);
            if (!setup.SetSetupID(setupDID, createParts))
            {
                return(null);
            }
            setup.SetPlacementFrame(0x65);
            return(setup);
        }
Ejemplo n.º 3
0
        public static PartArray CreateSetup(PhysicsObj owner, int setupDID, bool createParts)
        {
            var parts = new PartArray();

            parts.Owner = owner;
            parts.Sequence.SetObject(owner);
            if (!parts.SetSetupID(setupDID, createParts))
            {
                return(null);
            }
            parts.SetPlacementFrame(0x65);
            return(parts);
        }
Ejemplo n.º 4
0
        public static PartArray CreateParticle(PhysicsObj owner, int numParts, Sphere sortingSphere = null)
        {
            var particle = new PartArray();

            particle.Owner = owner;
            particle.Sequence.SetObject(owner);

            particle.Setup = Setup.MakeParticleSetup(numParts);

            if (particle.Setup == null || !particle.InitParts())
            {
                return(null);
            }

            return(particle);
        }
Ejemplo n.º 5
0
 public bool MorphToExistingObject(PartArray obj)
 {
     DestroyParts();
     Setup = obj.Setup;
     // add reference?
     Scale    = new Vector3(obj.Scale.X, obj.Scale.Y, obj.Scale.Z);
     NumParts = obj.NumParts;
     Parts    = new List <PhysicsPart>((int)obj.NumParts);
     InitPals();
     for (var i = 0; i < NumParts; i++)
     {
         Parts[i]              = PhysicsPart.MakePhysicsPart(obj.Parts[i]);
         Parts[i].PhysObj      = Owner;
         Parts[i].PhysObjIndex = i;
         // removed palette references
     }
     return(true);
 }