Пример #1
0
void OGRE3DRenderSystem::destroyPointRenderable(OGRE3DPointRenderable* renderable)
{
 if (renderable == 0)
  return;
 mPointRenderables.remove(renderable);
 NxOgre_Delete(renderable);
}
Пример #2
0
Material* Scene::createMaterial(const MaterialDescription& description)
{
    NxOgre::MaterialPrototype* prototype = NxOgre_New(MaterialPrototype)();
    Functions::PrototypeFunctions::MaterialDescriptionToMaterialPrototype(description, prototype);
    Material* material = createMaterial(prototype);
    NxOgre_Delete(prototype);
    return material;
}
Пример #3
0
void OGRE3DRenderSystem::destroyBody(OGRE3DBody* body)
{
 if (body == 0 || body->getClassType() != _OGRE3DBody)
  return;
 
 mBodies.remove(body);
 
 NxOgre_Delete(body);
}
Пример #4
0
void  OGRE3DRenderSystem::destroyKinematicBody(OGRE3DKinematicBody* kinematicBody)
{
 if (kinematicBody == 0 || kinematicBody->getClassType() != _OGRE3DKinematicBody)
  return;
 
 mKinematicBodies.remove(kinematicBody);
 
 NxOgre_Delete(kinematicBody);
}
Пример #5
0
Scene::~Scene(void)
{
/// TimeController::getSingleton()->removeListener(this);
    if (mSDK && mScene)
    {
        mActors.destroyAll();
        mSceneGeometries.destroyAll();
        mKinematicActors.destroyAll();
        mKinematicControllers.destroyAll();
        mVolumes.destroyAll();
        mMaterials.destroyAll();
        mCloths.destroyAll();
        mSoftBodies.destroyAll();
        NxOgre_Delete(mSceneTimer);
        mSDK->releaseScene(*mScene);
        NxOgre_Delete(mPhysXCallback);
    }
}
Пример #6
0
void RigidBody::destroy(void)
{
 if (mActor)
 {
  PhysXPointer* ptr = pointer_cast(mActor->userData);
  NxOgre_Delete(ptr);
  NxScene& scene = mActor->getScene();
  scene.releaseActor(*mActor);
 }
}
UniformResourceIdentifier::~UniformResourceIdentifier(void)
{
 if (mReferences)
 {
  if (--(*mReferences) == 0)
  {
   NxOgre_Delete(mURI);
   NxOgre_Unallocate(mReferences);
  }
 }
}
Пример #8
0
KinematicActor* Scene::createKinematicActor(Shapes shapes, const Matrix44& pose, const RigidBodyDescription& description)
{
    RigidBodyPrototype* prototype = NxOgre_New(RigidBodyPrototype)();
    Functions::PrototypeFunctions::RigidBodyDescriptionToRigidBodyPrototype(description, prototype);
    prototype->mShapes = shapes;
    prototype->mGlobalPose = pose;
    prototype->mType = Enums::RigidBodyType_Kinematic;
    KinematicActor* kactor = NxOgre_New(KinematicActor)(prototype, this);
    NxOgre_Delete(prototype);
    mKinematicActors.insert(kactor);
    return kactor;
}
Пример #9
0
SceneGeometry* Scene::createSceneGeometry(Shape* shape, const Matrix44& pose, const RigidBodyDescription& description)
{
    RigidBodyPrototype* prototype = NxOgre_New(RigidBodyPrototype)();
    Functions::PrototypeFunctions::RigidBodyDescriptionToRigidBodyPrototype(description, prototype);
    prototype->mShapes.insert(shape);
    prototype->mType = Enums::RigidBodyType_Geometry;
    prototype->mGlobalPose = pose;
    SceneGeometry* scene_geometry = NxOgre_New(SceneGeometry)(prototype, this);
    NxOgre_Delete(prototype);
    mSceneGeometries.insert(scene_geometry);
    return scene_geometry;
}
Пример #10
0
Actor* Scene::createActor(Shape* shape, const Matrix44& pose, const RigidBodyDescription& description)
{
    RigidBodyPrototype* prototype = NxOgre_New(RigidBodyPrototype)();
    Functions::PrototypeFunctions::RigidBodyDescriptionToRigidBodyPrototype(description, prototype);
    prototype->mShapes.insert(shape);
    prototype->mType = Enums::RigidBodyType_Dynamic;
    prototype->mGlobalPose = pose;
    Actor* actor = NxOgre_New(Actor)(prototype, this);
    NxOgre_Delete(prototype);
    mActors.insert(actor);
    return actor;
}
Пример #11
0
Volume* Scene::createVolume(Shapes shapes, const Matrix44& pose, Callback* callback, Enums::VolumeCollisionType vct)
{
    RigidBodyPrototype* prototype = NxOgre_New(RigidBodyPrototype)();
    prototype->mShapes = shapes;
    prototype->mGlobalPose = pose;
    prototype->mType = Enums::RigidBodyType_Volume;
    prototype->mVolumeCollisionType = vct;
    Volume* volume = NxOgre_New(Volume)(prototype, this, callback);
    NxOgre_Delete(prototype);
    mVolumes.insert(volume);
    return volume;
}
Пример #12
0
void ResourceSystem::closeArchive(const NxOgre::String &name)
{
  for (unsigned int i=0;i < mArchives.size(); i++)
 {
  if (mArchives[i]->getName() == name)
  {
   mArchives.remove(i);
   Archive* archive = mArchives[i];
   NxOgre_Delete(archive);
   return;
  }
 }
}
void UniformResourceIdentifier::set(const UniformResourceIdentifier& other)
{
 if (mReferences)
 {
  if (--(*mReferences) == 0)
  {
   NxOgre_Delete(mURI);
   NxOgre_Unallocate(mReferences);
  }
 }
 mURI = other.mURI;
 mReferences = other.mReferences;
 if (mReferences)
  (*mReferences)++;
}
UniformResourceIdentifier& UniformResourceIdentifier::operator=(const UniformResourceIdentifier& other)
{
 if (mReferences)
 {
  if (--(*mReferences) == 0)
  {
   NxOgre_Delete(mURI);
   NxOgre_Unallocate(mReferences);
  }
 }
 mURI = other.mURI;
 mReferences = other.mReferences;
 if (mReferences)
  (*mReferences)++;

 return *this;
}
Пример #15
0
OGRE3DBody* OGRE3DRenderSystem::createBody(NxOgre::Shape* shape, NxOgre::Vec3 position, const Ogre::String& meshName,  const NxOgre::RigidBodyDescription& description)
{
 // Create a OGRE3DPrototype using the NxOgre_New macro, all NxOgre classes and classes that
 // use PointerClass should use NxOgre_New and NxOgre_Delete.
 OGRE3DRigidBodyPrototype* prototype = NxOgre_New(OGRE3DRigidBodyPrototype)();
 
 if (prototype->mSceneManager == 0)
  prototype->mSceneManager = mSceneManager;
 
 // Send the physics stuff from the description into the prototype. This is quite important.
 NxOgre::Functions::PrototypeFunctions::RigidBodyDescriptionToRigidBodyPrototype(description, prototype);
 
 // We want a dynamic rigid body, that jumps around in the fjords with other dynamic rigid bodies.
 prototype->mType = NxOgre::Enums::RigidBodyType_Dynamic;

 // Copy the position over to the prototype.
 prototype->mGlobalPose.identity();
 prototype->mGlobalPose.set(position);

 // Add the shape to the list of shapes in the prototype.
 prototype->mShapes.insert(shape);

 // And our bits.
 prototype->mMeshName = meshName;

 // Create the body using again the NxOgre_New macro. Passing on the prototype we just created and a copy
 // of the scene pointer. we are using.
 OGRE3DBody* body = NxOgre_New(OGRE3DBody)(prototype, this);

 // Since the OGRE3DBody and NxOgre no longer needs the prototype, and we don't either. It's time to clean up.
 NxOgre_Delete(prototype);

 // Make a local copy.
 mBodies.insert(body);

 // And we are done.
 return body;
}
Пример #16
0
OGRE3DKinematicBody* OGRE3DRenderSystem::createKinematicBody(NxOgre::Shape* shape, NxOgre::Vec3 position, Ogre::SceneNode* node, const NxOgre::RigidBodyDescription& description)
{
	// Create a OGRE3DPrototype using the NxOgre_New macro, all NxOgre classes and classes that
	// use PointerClass should use NxOgre_New and NxOgre_Delete.
	OGRE3DRigidBodyPrototype* prototype = NxOgre_New(OGRE3DRigidBodyPrototype)();

	if (prototype->mSceneManager == 0)
		prototype->mSceneManager = mSceneManager;

	// Send the physics stuff from the description into the prototype. This is quite important.
	NxOgre::Functions::PrototypeFunctions::RigidBodyDescriptionToRigidBodyPrototype(description, prototype);

	// We want a kinematic rigid body, so it can laugh at the other bodies as it defies gravity and ignores conventional forces.
	prototype->mType = NxOgre::Enums::RigidBodyType_Kinematic;

	// Copy the position over to the prototype.
	prototype->mGlobalPose.identity();
	prototype->mGlobalPose.set(position);

	// Add the shape to the list of shapes in the prototype.
	prototype->mShapes.insert(shape);

	// And our bits.
	prototype->mNode=node;

	// Create the body using again the NxOgre_New macro. Passing on the prototype we just created and a copy
	// of the scene pointer. we are using.
	OGRE3DKinematicBody* kinematicBody = NxOgre_New(OGRE3DKinematicBody)(prototype, this);

	// Since the OGRE3DBody and NxOgre no longer needs the prototype, and we don't either. It's time to clean up.
	NxOgre_Delete(prototype);

	// Make a local copy.
	mKinematicBodies.insert(kinematicBody);

	// And we are done.
	return kinematicBody;
}
Пример #17
0
VisualDebugger::~VisualDebugger(void)
{
 NxOgre_Delete(mMeshData);
}
Пример #18
0
void Scene::destroyMaterial(Material* material)
{
    mMaterials.remove(material);
    NxOgre_Delete(material);
}
Пример #19
0
void Scene::destroyJoint(Joint* joint)
{
    mJoints.remove(joint);
    NxOgre_Delete(joint);
}
Пример #20
0
void Scene::destroyCloth(Cloth* cloth)
{
    mCloths.remove(cloth);
    NxOgre_Delete(cloth);
}
Пример #21
0
void Scene::destroySoftBody(SoftBody* cloth)
{
    mSoftBodies.remove(cloth);
    NxOgre_Delete(cloth);
}