Which Physics engine
-
- Posts: 62
- Joined: Wed Feb 06, 2013 12:11 pm
Which Physics engine
Hi all,
can you say me, which physic engine is the best to use, including the aspects of difficulty of implementation, speed, tutorials and so on.
What are you're favourites?
can you say me, which physic engine is the best to use, including the aspects of difficulty of implementation, speed, tutorials and so on.
What are you're favourites?
Re: Which Physics engine
http://bulletphysics.org/wordpress/ Seems to me like it is the most feature rich :)
Dream Big Or Go Home.
Help Me Help You.
Help Me Help You.
Re: Which Physics engine
I prefer PhysX 2.81 myself. (3.0 has some issues with the terrain that I never worked out)
I have used PhysX, Bullet and ODE in my app and always return to PhysX, but in the end, it is all personal preference i think.
Also, PhysX allows me to offload the work form the cpu if a GeForce card is available.
I have used PhysX, Bullet and ODE in my app and always return to PhysX, but in the end, it is all personal preference i think.
Also, PhysX allows me to offload the work form the cpu if a GeForce card is available.
-
- Posts: 17
- Joined: Sun Oct 13, 2013 1:52 am
Re: Which Physics engine
well, I don't know much about it but if the game mechanics are 2d, then box2d should work.
If the mechanics are 3d then... ok I don't know. All I know about 3d ones is that physX is optimized towards nvidia graphics cards and bullet physics are generally used for movies instead of video games.
If the mechanics are 3d then... ok I don't know. All I know about 3d ones is that physX is optimized towards nvidia graphics cards and bullet physics are generally used for movies instead of video games.
-
- Posts: 62
- Joined: Wed Feb 06, 2013 12:11 pm
Re: Which Physics engine
Is there an engine which can handle collisions with bones and joints (if something hits a person)?
Re: Which Physics engine
If I remember well, physx can handle joint collisions.
Re: Which Physics engine
We are using PhysX 3.2.4 with Octodad and it does pretty well. PhysX 3+ seems to perform well on any CPU, though can accelerate some things like particle effects on NVIDIA cards. There's quite a lot of setup involved to get complex behavior, though.
Re: Which Physics engine
luthyr,
Could you post the terrain physX code for us? I would prefer to use the 3.## series, but cannot get that to work.
You have no idea how much we would appreciate it!
Could you post the terrain physX code for us? I would prefer to use the 3.## series, but cannot get that to work.
You have no idea how much we would appreciate it!
-
- Posts: 62
- Joined: Wed Feb 06, 2013 12:11 pm
Re: Which Physics engine
Did I understand wright, if I say that PhysX does not only works with nvidia graphics cards?
Edit: And where can i download the SDK, do you know any usefull tutorials
Edit: And where can i download the SDK, do you know any usefull tutorials
Re: Which Physics engine
search PhysX SDK, sign up, download and begin using.
PhysX works without geforce card yes.
PhysX works without geforce card yes.
Re: Which Physics engine
Bullet has support for it. I use this engine in all my private projects and it works great.Christi258 wrote:Is there an engine which can handle collisions with bones and joints (if something hits a person)?
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Re: Which Physics engine
Sorry, we aren't using terrain in our game.Seven wrote:luthyr,
Could you post the terrain physX code for us? I would prefer to use the 3.## series, but cannot get that to work.
You have no idea how much we would appreciate it!
This is what we use for our mesh code, though:
Code: Select all
// -----------------------------------------------------------------------
PxTriangleMesh* PhysicsFactory::createTriangleMesh(
scene::IMeshBuffer* meshBuffer,
const core::vector3df& scale)
{
if (!m_sdk) return 0;
if (!meshBuffer) return NULL;
PxTriangleMesh* triMesh = NULL;
PxVec3* verts = new PxVec3[meshBuffer->getVertexCount()];
switch (meshBuffer->getVertexType())
{
case video::EVT_STANDARD: {
video::S3DVertex* vertices = (video::S3DVertex*)meshBuffer->getVertices();
for (u32 i = 0 ; i < meshBuffer->getVertexCount() ; ++i)
verts[i] = PxVec3(
vertices[i].Pos.X * scale.X,
vertices[i].Pos.Y * scale.Y,
vertices[i].Pos.Z * scale.Z);
break;
}
case video::EVT_2TCOORDS: {
video::S3DVertex2TCoords* vertices =
(video::S3DVertex2TCoords*)meshBuffer->getVertices();
for (u32 i = 0 ; i < meshBuffer->getVertexCount() ; ++i)
verts[i] = PxVec3(
vertices[i].Pos.X * scale.X,
vertices[i].Pos.Y * scale.Y,
vertices[i].Pos.Z * scale.Z);
break;
}
case video::EVT_TANGENTS: {
video::S3DVertexTangents* vertices =
(video::S3DVertexTangents*)meshBuffer->getVertices();
for (u32 i = 0 ; i < meshBuffer->getVertexCount() ; ++i)
verts[i] = PxVec3(
vertices[i].Pos.X * scale.X,
vertices[i].Pos.Y * scale.Y,
vertices[i].Pos.Z * scale.Z);
break;
}
}
// Build the triangle mesh.
PxTriangleMeshDesc meshDesc;
meshDesc.points.count = meshBuffer->getVertexCount();
meshDesc.triangles.count = meshBuffer->getIndexCount() / 3;
meshDesc.points.stride = sizeof(PxVec3);
meshDesc.triangles.stride = 3*sizeof(u16);
meshDesc.points.data = verts;
meshDesc.triangles.data = meshBuffer->getIndices();
meshDesc.flags = PxMeshFlag::e16_BIT_INDICES;
PxDefaultMemoryOutputStream out;
if (m_cooking->cookTriangleMesh(meshDesc, out))
{
//Create the mesh from the cooked data.
PxDefaultMemoryInputData in(out.getData(), out.getSize());
triMesh = m_sdk->createTriangleMesh(in);
//m_cooking->release();
}
else
printf("Failed triangle mesh cooking\n");
zaparr(verts);
if (!triMesh) {
printf("Failed to create triangle mesh\n");
return NULL;
}
return triMesh;
}
// -----------------------------------------------------------------------
PxRigidActor* PhysicsFactory::createMesh(
PxTransform transform,
IAnimatedMesh* colMesh,
vector3df scale,
float mass,
float restitution,
float friction,
bool isStatic)
{
if (!m_sdk) return 0;
if (!colMesh) return 0;
const float HEIGHT = 20.0f; // meters high above the plane
const PxVec3 POSITION = PxVec3(0.0f, HEIGHT, 0.0f);
PxRigidActor* actor;
if (isStatic)
actor = m_sdk->createRigidStatic(transform);
else
actor = m_sdk->createRigidDynamic(transform);
PxTriangleMesh* triMesh;
PxMaterial* material = createMaterial(friction, friction, restitution);
for (unsigned int i = 0; i < colMesh->getMeshBufferCount(); i++)
{
triMesh = createTriangleMesh(
colMesh->getMeshBuffer(i), scale);
actor->createShape(PxTriangleMeshGeometry(triMesh), *material);
triMesh->release();
}
if (!isStatic)
{
PxRigidBodyExt::setMassAndUpdateInertia(*((PxRigidDynamic*)actor), mass);
}
addToScene(actor);
return actor;
}
Re: Which Physics engine
Thanks! it seems that I should post out physX code somewhere. It isnt great code, but it seems to work for us.... hmmm.. maybe tonight.
-
- Posts: 62
- Joined: Wed Feb 06, 2013 12:11 pm
Re: Which Physics engine
Well at least I decided to work with bullet.Nadro wrote:Bullet has support for it. I use this engine in all my private projects and it works great.
Can you say me, how to get started?
Do you use coincidentally Visual Studio 2012?
Re: Which Physics engine
You can use build/vs2010.bat for generate VS2010 projects. Those projects you can import in VS2012 without any problems.
For some basic infos about Bullet you should check Bullet_User_Manual.pdf included in Bullet archive. You can find some nice tips also on Bullet wiki: http://bulletphysics.org/mediawiki-1.5. ... /Main_Page
For some basic infos about Bullet you should check Bullet_User_Manual.pdf included in Bullet archive. You can find some nice tips also on Bullet wiki: http://bulletphysics.org/mediawiki-1.5. ... /Main_Page
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes