Reactor.RMesh.Load C# (CSharp) Method

Load() public method

public Load ( string filename ) : void
filename string
return void
        public void Load(string filename)
        {
            _model = REngine.Instance._content.Load<Model>(filename);

            _transforms = new Matrix[_model.Bones.Count];

            _model.CopyAbsoluteBoneTransformsTo(_transforms);

            Matrix = Matrix.CreateScale(1.0f);
            Scaling = new Vector3(1f, 1f, 1f);
            Matrix = BuildScalingMatrix(Matrix);

            foreach(ModelMesh mesh in _model.Meshes)
            {
                BoundingSphere sphere = mesh.BoundingSphere;
                BoundingBox box = BoundingBox.CreateFromSphere(sphere);
                _boundingBox = BoundingBox.CreateMerged(_boundingBox, box);

            }
        }