6 registered members (AndrewAMD, Ayumi, degenerate_762, 7th_zorro, VoroneTZ, HoopyDerFrood),
1,268
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Newton 2 wrapper
[Re: darkinferno]
#291258
09/24/09 09:08
09/24/09 09:08
|
Joined: Dec 2003
Posts: 1,225 germany
gri
Serious User
|
Serious User
Joined: Dec 2003
Posts: 1,225
germany
|
hi VET,
please keep up your process on that.
Because of at least 2 Reasons:
1. You put already much energy and time in your Wrapper.
2. Its good for us all to have an Alternative to the PhysX Plugin(of course its great).
The A8 version somedays comes with PhysX only because ODE is outdated.
So if one of us needs Physics in his game but dont want to forcing the customers to install the PhysX Drivers, then is the Use of your wrapper the right Decision.
And I think NOT a lot uf us needs Physics for Clothing in our games in near future. (Even with PhysX its only a Gadget without practical Use in Moment - it only decreasing the Framerate )
So keep up your good work.
greetings, maik
"Make a great game or kill it early" (Bruce Shelley, Ensemble Studios)
|
|
|
Re: Newton 2 wrapper
[Re: jweb]
#291881
09/28/09 18:13
09/28/09 18:13
|
Joined: Aug 2004
Posts: 1,345 Kyiv, Ukraine
VeT
OP
Serious User
|
OP
Serious User
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
|
jweb, you can code everything you want: files for using DLL are ready... now i'm working only on examples (so, if programmer knows Newton good, he can create car even with v.1 of wrapper ) Thatks for good words, guys, Newton beta 10 is out, i'll continue my wrapper
|
|
|
Re: Newton 2 wrapper
[Re: VeT]
#291947
09/29/09 09:51
09/29/09 09:51
|
Joined: Dec 2003
Posts: 1,225 germany
gri
Serious User
|
Serious User
Joined: Dec 2003
Posts: 1,225
germany
|
hi VET,
one question:
First I thought I have to install something because I couldnt control the camera in your examples.
Then I put in some code for camera movement & rotating and it works. Did you just forget it in the last version?
,gri
"Make a great game or kill it early" (Bruce Shelley, Ensemble Studios)
|
|
|
Re: Newton 2 wrapper
[Re: FBL]
#292535
10/04/09 15:33
10/04/09 15:33
|
Joined: Sep 2003
Posts: 9,859
FBL
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 9,859
|
more things: I'd like to have an interface for newtonFPS so I can modify it without having to change your script. Also I have added two useful functions, maybe you want to include them in the wrapper:
NewtonJoint* newton_getjoint(ENTITY* entBody)
{
NewtonJoint* psJoint = NULL;
if (entBody->skill98 != 0)
{
psJoint = entBody->skill98;
}
return psJoint;
}
NewtonBody* newton_getbody(ENTITY* entBody)
{
NewtonBody* psBody = NULL;
if (entBody->skill99 != 0)
{
psBody = entBody->skill99;
}
return psBody;
}
I store the joint pointer in skill98 of the object. Next thing: newton_materials_init() should not be included in newton_start() as it seems to be a definition for special physics samples. Quant2meter and meter2quant should already be included in newton_main.c like this: #ifndef QUANTTOMETER #define QUANTTOMETER (float)0.03125 #endif #ifndef METERTOQUANT #define METERTOQUANT (float)32 #endif This allows redefining them before inclusion of the wrapper in the own project I also added this simple thing to newton_main.c:
NewtonWorld* nworld = NULL;
NewtonWorld* newton_getworld()
{
return nworld;
}
Now nworld doesn't have to be defined in own scripts. If it's needed, it can be retrieved via this access function. The goal of all my requests: I can just drop the latest release in my project folder, without having to adjust a single line Maybe you want to include some of this stuff in the next version of the wrapper. Thanks for reading
|
|
|
Re: Newton 2 wrapper
[Re: FBL]
#292536
10/04/09 15:40
10/04/09 15:40
|
Joined: Sep 2003
Posts: 9,859
FBL
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 9,859
|
Oh, right. I created a simple hinge setup function. Maybe you're interested:
NewtonJoint* newton_createhinge(VECTOR* vecPivot, VECTOR* vecAxis, ENTITY* entBody1, ENTITY* entBody2, void* fpCallback)
{
NewtonBody* psBody1 = NULL;
NewtonBody* psBody2 = NULL;
NewtonJoint* psJoint;
float* fpPivot;
float* fpAxis;
/* get Newton bodies */
if (entBody1 != NULL)
{
psBody1 = entBody1->skill99;
}
if (entBody2 != NULL)
{
psBody2 = entBody2->skill99;
}
fpPivot = vectorf(vecPivot);
fpPivot[0] *= QUANTTOMETER;
fpPivot[1] *= QUANTTOMETER;
fpPivot[2] *= QUANTTOMETER;
fpAxis = vectorf(vecAxis);
psJoint = NewtonConstraintCreateHinge (psWorld, fpPivot, fpAxis, psBody1, psBody2);
if (fpCallback != NULL)
{
NewtonHingeSetUserCallback (psJoint, fpCallback);
}
/* store joint pointers in related objects */
if (entBody1 != NULL)
{
entBody1->skill98 = psJoint;
}
if (entBody2 != NULL)
{
entBody2->skill98 = psJoint;
}
}
|
|
|
Re: Newton 2 wrapper
[Re: FBL]
#292550
10/04/09 17:58
10/04/09 17:58
|
Joined: Aug 2004
Posts: 1,345 Kyiv, Ukraine
VeT
OP
Serious User
|
OP
Serious User
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
|
Then I put in some code for camera movement & rotating and it works. Did you just forget it in the last version?
Hm, really, i confirmed this bug... Maybe, this is beacuse of new version of GS, as i never get this before and nobody told me about this. Now i'll add camera code, make and upload pictures, re-read your posts and release new version. 2Firoball thanks for code, i'll look into it and add it to next version, if everything would be okay thanks for your code, looking like usefull
|
|
|
Re: Newton 2 wrapper
[Re: VeT]
#292558
10/04/09 19:55
10/04/09 19:55
|
Joined: Sep 2003
Posts: 9,859
FBL
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 9,859
|
How about a slider hinge?
NewtonJoint* newton_createslider(VECTOR* vecPivot, VECTOR* vecDir, ENTITY* entBody1, ENTITY* entBody2, void* fpCallback)
{
NewtonBody* psBody1 = NULL;
NewtonBody* psBody2 = NULL;
NewtonJoint* psJoint;
float* fpPivot;
float* fpDir;
/* get Newton bodies */
if (entBody1 != NULL)
{
psBody1 = entBody1->skill99;
}
if (entBody2 != NULL)
{
psBody2 = entBody2->skill99;
}
fpPivot = vectorf(vecPivot);
fpPivot[0] *= QUANTTOMETER;
fpPivot[1] *= QUANTTOMETER;
fpPivot[2] *= QUANTTOMETER;
fpDir = vectorf(vecDir);
psJoint = NewtonConstraintCreateSlider(psWorld, fpPivot, fpDir, psBody1, psBody2);
if (fpCallback != NULL)
{
NewtonSliderSetUserCallback (psJoint, fpCallback);
}
/* store joint pointers in related objects */
if (entBody1 != NULL)
{
entBody1->skill98 = psJoint;
}
if (entBody2 != NULL)
{
entBody2->skill98 = psJoint;
}
}
Thought I might share this. Almost the same code like for a hinge though.
|
|
|
|