2 registered members (AndrewAMD, TipmyPip),
747
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Newton 2 wrapper
[Re: VeT]
#265409
05/12/09 13:34
05/12/09 13:34
|
Joined: Aug 2004
Posts: 1,345 Kyiv, Ukraine
VeT
OP
Serious User
|
OP
Serious User
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
|
Here is my PMs with Julio(creator of Newton): *****
Plus I am also adding eth CUDA support so the next Beta will come with Hardware simulation on GPU. Therefore it will provide the same level of mass physics simulation as other commercial engine but with a real newtonian base physics engine like ODE, as opposed to a Impulse base Physics engine like all the others.
There are many, many reasons why a force based engine is far superior than a impulse base, although it have to be slower by nature, but as you can see Newton 2.0 is quite competitive.
******
also, can you give me more details about impulse and force-based physical engine?
Impulase base for force base p[hysic sare teh tow diffrent metod to make physis simulation. Impulse was proposed by Brians Mirtich http://www.kuffner.org/james/software/dynamics/mirtich/index.html and force base was propose by Davif Baraff http://www.cs.cmu.edu/~baraff/papers/sig96.pdf Impulse base very eassy to implement and is the methed used by Physx and Havok, it is also the method used by open source since they are all biproduct of Havov and PhyiX written by ex employee that when they leave the company use and older copy and re write as open source. the problem with open source is the teh are incorrect since they violate a physics principle that state that and impulse can only be appliyed at and infinitesimal small period of time. They apply impulse an dintegrate then as if tehey where forces, theyfor tehy are unstable and thsi si whay you see hundere of paore teh try to sov eteh problems. Force base implementation are base on rigurose law of physics call the method of the virtual work, they are harder to solve but the are more stable and have the ability that the same solver solve all know rigid body problems.
|
|
|
Re: Newton 2 wrapper
[Re: Hitsch]
#265487
05/12/09 17:54
05/12/09 17:54
|
Joined: Aug 2004
Posts: 1,345 Kyiv, Ukraine
VeT
OP
Serious User
|
OP
Serious User
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
|
2 Felixsg I talked to jcl, he promised to implement... i think, he waits for the full version of Newton, not for betas. Anyway, all functionality of Newton is enabled in first version of wrapper: 2-18 versions just show, how to use Newton for different effects.. If you know, how to create car using Newton, you can make it with the LiteCNewton2.16.v1.rar (well, in the latest versions there are fixed some minor bugs in header, but i hope you got the idea) 2 Hitsch Yes, more accurate and stable.. try those links, if you want additional information
|
|
|
Re: Newton 2 wrapper
[Re: VeT]
#265497
05/12/09 19:19
05/12/09 19:19
|
Joined: Oct 2007
Posts: 5,210 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
|
hey vet, i started to play with your wrapper again, and just to let you know: the ent_setmatrix_rb function needs to be changed to work with 7.77, or entites have a wrong tilt value(random?) this is the updated version:
void ent_setmatrix_rb(ENTITY *entity, float *m)
{
float pan, tilt, roll;
if(fabs(m[2]) > 0.9999) // looking straight up or down -> gimbal lock
{
pan = atan2(-m[4], m[5]); // -m[4]?
tilt = 1.570796 * sign(m[2]);
roll = 0;
}
else
{
pan = atan2(m[1], m[0]); // swap?
tilt = atan2(m[2],sqrt(m[1]*m[1] + m[0]*m[0]));
roll = atan2(m[6], m[10]);
}
entity->pan = pan * RAD2DEG;
entity->tilt = tilt * RAD2DEG;
entity->roll = roll * RAD2DEG;
entity->x = m[12] * METERTOQUANT;
entity->y = m[13] * METERTOQUANT;
entity->z = m[14] * METERTOQUANT;
}
just to let you know.
3333333333
|
|
|
Re: Newton 2 wrapper
[Re: VeT]
#265627
05/13/09 12:22
05/13/09 12:22
|
Joined: Dec 2008
Posts: 1,218 Germany
Rackscha
Serious User
|
Serious User
Joined: Dec 2008
Posts: 1,218
Germany
|
Hi How can i set up constraints? i dont get it. In ODE i had to use Vectors to set the anglepoint and the axis the constraint rotates around. But what are dfloats? Can someone give me an example? I used vectors(of course wrong) and the second body disapeared:
vec_for_bone(temp,my,"Bone9"); ent=ent_create("box_a.mdl",vector(temp.x,temp.y,temp.z+20),bone); bone_t=newton_addentity(ent,0,NEWTON_BOX,onforceandtorque);
you=ent_create("box_a.mdl",vector(temp.x,temp.y10,temp.z20),bone);
ragdoll_ent=newton_addentity(you,70,NEWTON_BOX,onforceandtorque);
NewtonConstraintCreateHinge(nworld,ent.x,vector(0,1,0),bone_t,ragdoll_ent); Greets Rackscha
MY Website with news of my projects: (for example my current Muliplayer Bomberman, GenesisPrecompiler for LiteC and TileMaster, an easy to use Tile editor) Sparetime-Development
|
|
|
Re: Newton 2 wrapper
[Re: Rackscha]
#265637
05/13/09 13:02
05/13/09 13:02
|
Joined: Oct 2007
Posts: 5,210 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
|
dfloats are just floats,
you can try using dfloat mypoint[3]; instead of a vector
also there was a rope example in the Vet's wrapper that utilizes joints if i recall correctly.
3333333333
|
|
|
|