ODE Physics[FTE or DP]

Discuss programming in the QuakeC language.
Post Reply
Max_Salivan
Posts: 96
Joined: Thu Dec 15, 2011 1:00 pm

ODE Physics[FTE or DP]

Post by Max_Salivan »

Hello guys,anyone know something about ODE?

In Darkplaces we have libode1(497kb) and defs,its working good,but i have some problems with moving physics,looks like its stoping lol

Code: Select all

/DP_PHYSICS
//idea: LordHavoc
//darkplaces implementation: LordHavoc, divVerent
//constant definitions:
float MOVETYPE_PHYSICS = 32;
float SOLID_PHYSICS_BOX = 32;
float SOLID_PHYSICS_SPHERE    = 33;
float SOLID_PHYSICS_CAPSULE = 34;

float JOINTTYPE_POINT          = 1; // point; uses origin (anchor)
float JOINTTYPE_HINGE          = 2; // hinge; uses origin (anchor) and angles (axis)
float JOINTTYPE_SLIDER          = 3; // slider; uses angles (axis)
float JOINTTYPE_UNIVERSAL       = 4; // universal; uses origin (anchor) and angles (forward is axis1, up is axis2)
float JOINTTYPE_HINGE2          = 5; // hinge2; uses origin (anchor), angles (axis1), velocity (axis2)
//field definitions:
.float mass;
.float bouncefactor;
.float bouncestop;
.float jointtype; // see JOINTTYPE_ definitions above
// common joint properties:
// .entity aiment, enemy; // connected objects
// .vector movedir;
//   for a spring:
//     movedir_x = spring constant (force multiplier, must be > 0)
//     movedir_y = spring dampening constant to prevent oscillation (must be > 0)
//     movedir_z = spring stop position (+/-)
//   for a motor:
//     movedir_x = desired motor velocity
//     movedir_y = -1 * max motor force to use
//     movedir_z = stop position (+/-), set to 0 for no stop
//   note that ODE does not support both in one anyway
//description:
//various physics properties can be defined in an entity and are executed via
//ODE

//builtin definitions:
void(entity e, float physics_enabled) physics_enable = #540; // enable or disable physics on object
void(entity e, vector force, vector force_pos) physics_addforce = #541; // apply a force from certain origin, length of force vector is power of force
void(entity e, vector torque) physics_addtorque = #542; // add relative torque
//description: provides Open Dynamics Engine support, requires extenal dll to be present or engine compiled with statical link option
//be sure to checkextension for it to know if library i loaded and ready, also to enable physics set "physice_ode" cvar to 1
//note: this extension is highly experimental and may be unstable
//note: use SOLID_BSP on entities to get a trimesh collision models on them
BUT,what about FTE?
all,what i found its

Code: Select all

#define ODE_PHYSICS
#ifdef ODE_PHYSICS
//DP_PHYSICS
float SOLID_PHYSICS_BOX = 32;
float SOLID_PHYSICS_SPHERE = 33;
float SOLID_PHYSICS_CAPSULE = 34;
float MOVETYPE_PHYSICS = 32;
.float mass;
#endif
and libgcc_s_sjlj-1.dll,libode.dll(5mb),libode.dll1(5 mb),libstdc++-6.dll.
How i can use it on FTE?)
Sorry for my english :)
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: ODE Physics[FTE or DP]

Post by Spike »

regarding fte vs dp, fte implements a slightly earlier version of dp's ode api, and thus omits the builtins (the fields+jointtype constants you have documented for dp should all exist in fte and work the same, but the builtins are stubs). just be sure to set sv_mintic and sv_maxtic to the same value or things can spontaneously go flying across the room - ode just needs a fixed tick rate.
fte will apparently try to dynamically link against an 'ode_double.dll' in win32 builds, 'libode1_64.dll' using the win64 build, or 'libode.so.1' on linux. If not found or incompatible, the physics_ode_enable cvar will be force-set-and-locked to 0.
fte provides ode clientside as well, while I've heard reports that dp's ode implementation is buggy if used from csqc. It may have since been fixed.

if you want to do special stuff like ragdoll, you'll need to combine it with the skeletal objects extension, ideally through csqc (note the end of my previous paragraph, sorry).
there is a simpler ragdoll alternative with fte that can give clientside ragdoll via purely ssqc, but I'm too lazy to document it, and its probably buggy anyway. :s
Max_Salivan
Posts: 96
Joined: Thu Dec 15, 2011 1:00 pm

Re: ODE Physics[FTE or DP]

Post by Max_Salivan »

ahh,thanks,Spike,got it in FTE,just set physics_ode_enable to 1
i have ode_double.dll,but where i can find libode1_64.dll?

i am use only SSQC,but its works good

What should be
sv_mintic and sv_maxtic ?
Sorry for my english :)
Cobalt
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA
Contact:

Re: ODE Physics[FTE or DP]

Post by Cobalt »

Curious - if you set up a ded server with ODE physics enabled, do connecting clients also need this library on their side to take advantage? Have not ever seen an error preventing a client to connect without the proper library.
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: ODE Physics[FTE or DP]

Post by Spike »

mintic and maxtic should be set to the same value, otherwise time differences can result in singularities and thus bounding, jiggling, or sudden explosions (yay!). 0.013 or so is a good choice for about 72fps.

cobalt, if the physics are used only by ssqc then only the server needs the extra ode dependancy.
if you're doing ragdoll and stuff, you're probably best to use ode in csqc instead due to reduced networking costs, and this requires ode libraries clientside.
a client will never be kicked, its just that physics_ode_enable will be readonly and set to 0, and all the ode movetypes won't do anything (same as you get serverside).
I believe DP is basically the same, but ode support in csqc is unsupported in DP (the cvar might be different too).
Cobalt
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA
Contact:

Re: ODE Physics[FTE or DP]

Post by Cobalt »

Im wanting to try and experiment with the ODE environment. I have the cvar set, and DP (Win) comes with an ode dll in wvery build, but the console says it fails to load. Over in the Linux environment, the libraries for ODE that come in the repos all seem to load no problem. I dont know if they are double precision or not, but another post here on this site, said at least for Win they have to be double precision? Cant find one for a Win 64 bit environment either.

If Im reading Spikes answer right, ded server implimentation would be resource heavy? Why would that be if both server and client are obeying the same physics laws provided the (2) libraries are compatable?
Spike wrote:cobalt, if the physics are used only by ssqc then only the server needs the extra ode dependancy.
if you're doing ragdoll and stuff, you're probably best to use ode in csqc instead due to reduced networking costs, and this requires ode libraries clientside.
a client will never be kicked, its just that physics_ode_enable will be readonly and set to 0, and all the ode movetypes won't do anything (same as you get serverside).
I believe DP is basically the same, but ode support in csqc is unsupported in DP (the cvar might be different too).
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: ODE Physics[FTE or DP]

Post by Spike »

Cobalt wrote: If Im reading Spikes answer right, ded server implimentation would be resource heavy? Why would that be if both server and client are obeying the same physics laws provided the (2) libraries are compatable?
Spike wrote:networking costs
(the rest is a dependancy+support thing)

win64 runs win32 binaries too. its easier to just not bother with win64 stuff. then users don't have to know what sort of system they're using. its just easier, okay? :s
Cobalt
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA
Contact:

Re: ODE Physics[FTE or DP]

Post by Cobalt »

Im not sure that is the case with DP 64 for win. I suppose I could try putting a 32 bit dll in there to see.

I thought merely altering the entities movetype to that of the ODE designation is the only real newworking cost associated to the entity. Dont the ODE physics take the rest from there, client side?
Spike wrote: win64 runs win32 binaries too. its easier to just not bother with win64 stuff. then users don't have to know what sort of system they're using. its just easier, okay? :s
Post Reply