Example #1
0
        public ModelObject(string id, ActorType actorType,
                           Transform3D transform, Model model, ColorParameters colorParameters, Effect effect)
            : base(id, actorType, transform, colorParameters, effect)
        {
            this.model = model;

            /* 3DS Max models contain meshes (e.g. a table might have 5 meshes i.e. a top and 4 legs) and each mesh contains a bone.
             *  A bone holds the transform that says "move this mesh to this position". Without 5 bones in a table all the meshes would collapse down to be centred on the origin.
             *  Our table, wouldnt look very much like a table!
             *
             *  Take a look at the ObjectManager::DrawObject(GameTime gameTime, ModelObject modelObject) method and see if you can figure out what the line below is doing:
             *
             *  effect.World = modelObject.BoneTransforms[mesh.ParentBone.Index] * modelObject.GetWorldMatrix();
             */
            InitializeBoneTransforms();
        }
Example #2
0
 public DrawnActor3D(string id, ActorType actorType, Transform3D transform,
                     ColorParameters colorParameters, Effect effect) : base(id, actorType, transform)
 {
     this.colorParameters = colorParameters;
     this.effect          = effect;
 }