urho3d / urho3d

Game engine
https://urho3d.github.io
MIT License
4.55k stars 997 forks source link

Support of physics ? #131

Closed Hevedy closed 10 years ago

Hevedy commented 10 years ago

Hi. I reading the docs of engine and have

Basic physics Ragdolls Constraits but don't find about this: Have support or will have for inverse kinematic in animated models (like characters). Gravity zones, speed zones, water volumes or wind zones... for physics? Cloth (flag for example or character cloth). Ropes like source engine or cryengine. Breakable object, destroyable object and deformable object(1º static physics to dynamic physics, 2º model change, 3º the wireframe of object change in real time). And the physics in the particles(collision with ground...) ?

And other question, in network all physics are sync ? Don't have 2 class of physics to sync or not ? (big objects and very small objects like cans)

This is one of the best engines, nice work. Thanks.

hjmediastudios commented 10 years ago

I've been working on implementing a planetary gravity system, so I can say that, although there isn't out-of-the-box support for some of this stuff, it's pretty easy to create custom force systems using custom Component sub-classes- for wind or gravity zones, you can use the PhysicsWorld's GetRigidBodies function to find bodies in the affected regions and apply forces to the returned bodies.

cadaver commented 10 years ago

That's pretty much a no to all your questions of the individual features. I've seen a kind of a rope implemented with a skinned model and a chain of rigidbodies / constraints, but it's not built-in.

Physics are synced from server to client, but not the other way around. Note that there is no client-side prediction in the built-in protocol, as it would be difficult if not impossible to rewind a whole physics simulation when corrections from server arrive.

Hevedy commented 10 years ago

Ok. Ty. But in the network physics sync, i say for example 1º type of physics like you say with sync for big box and other objects in the map but other plus type 2º for non sync objects(this is only calculated in clients individual, no sync) for example for all small trash of ground, cans, bottles, papers ... this is a idea for no overload the network packets and physics. Only sync the important or relevant objects.

alexparlett commented 10 years ago

Ropes and Cloth could be supported if we implemented Bullet's softbody as well as the rigidbody. Its on my todo list for the future.

In the same vein, destructable objects are possible using bullets compound shape.

cadaver commented 10 years ago

@Hgdavidy We have the concept of "replicated" and "local" scene nodes. Unimportant objects could be created as local (typically on loading the level/scene) and their physics will not be network-synchronized. The client can also always spawn more local objects for client-side effects.

cadaver commented 10 years ago

Because this issue is more a discussion than a clear feature request or bug report, I'm closing it. The forum ( http://urho3d.prophpbb.com ) is better suited for discussions about whether certain features are implemented, or how to implement them.