Beispiel #1
0
        public void Load(TV_3DVECTOR startPosition)
        {
            _startPos = startPosition;

            // Mesh
            _mesh = _gameManager.TvScene.CreateMeshBuilder();
            _mesh.CreateSphere(4.5f);

            _mesh.SetLightingMode(CONST_TV_LIGHTINGMODE.TV_LIGHTING_NORMAL);
            _mesh.SetMaterial(_gameManager.CurrentLevel.StandardMaterial);
            _mesh.ComputeNormalsEx();

            // Physics
            _physicsBody = _gameManager.TvPhysics.CreateMeshBody(0.01f, _mesh, CONST_TV_PHYSICSBODY_BOUNDING.TV_BODY_BOX);

            _gameManager.TvPhysics.SetBodyMaterialGroup(_physicsBody, 0);
            _gameManager.TvPhysics.SetDamping(_physicsBody, 0.00001f, new TV_3DVECTOR());

            _gameManager.TvPhysics.SetBodyPosition(_physicsBody, _startPos.x, _startPos.y, _startPos.z);
        }