Пример #1
0
 public override void Dispose()
 {
     MaterialFactory.DeleteMaterial(materialIdx);
     Physics.DestroyBody(PhysicsId);
     mesh.Destroy();
     mesh = null;
 }
Пример #2
0
        public void Unload()
        {
            _gameManager.TvPhysics.DestroyBody(_fieldPhysicsBody);
            _field.Destroy();
            _field = null;
            _gameManager.TvMaterials.DeleteMaterial(StandardMaterial);

            _gameManager.TvLights.DeleteLight(_light);

            _gameManager.Player1.Bat.Unload();
            _gameManager.Player2.Bat.Unload();

            Ball.Unload();
        }
Пример #3
0
        public void RotateZAroundPoint(TV_3DVECTOR point, float angle)
        {
            TVMesh node = Scene.CreateMeshBuilder();

            node.SetPosition(point.x, point.y, point.z);
            mesh.AttachTo(CONST_TV_NODETYPE.TV_NODETYPE_MESH, node.GetIndex(), -1);
            TV_3DVECTOR nodePos = node.GetPosition();
            TV_3DMATRIX mat     = new TV_3DMATRIX();
            TV_3DMATRIX modyMat = node.GetMatrix();

            MathLibrary.TVMatrixRotationZ(ref mat, angle);
            node.SetRotationMatrix(mat);
            mesh.AttachTo(CONST_TV_NODETYPE.TV_NODETYPE_NONE, -1, -1);
            node.Destroy();
            mat = mesh.GetMatrix();
            Physics.SetBodyMatrix(PhysicsId, mat);
        }
Пример #4
0
        public override void Initialize()
        {
#if DEBUG
            Show = true;
#endif
            TVMesh mesh = Scene.CreateMeshBuilder(Name);
            mesh.CreateBox(1, 1, 1);
            mesh.SetPosition(Position.x, Position.y, Position.z);
            mesh.SetRotation(Rotation.x, Rotation.y, Rotation.z);
            mesh.SetScale(Scale.x, Scale.y, Scale.z);
            mesh.GetBoundingBox(ref boundingBoxMin, ref boundingBoxMax);
            mesh.Destroy();
            mesh = null;

            // Register object in Lua.
            ScriptManager.SetGlobal(Name, this);
        }
Пример #5
0
 public override void Dispose()
 {
     ReflectRS.Destroy();
     RefractRS.Destroy();
     mesh.Destroy();
 }
Пример #6
0
 public void Unload()
 {
     _gameManager.TvPhysics.DestroyBody(_physicsBody);
     _mesh.Destroy();
     _mesh = null;
 }