Anyone still using [newton] in some project ?

Posted By: Carloos

Anyone still using [newton] in some project ? - 08/13/13 18:02

First of all, hello everybody.

Long time no see around here, but I´m still alive.

I want to know if there is someone using newton wrapper at the moment for some project ( speccialy vehicle ones )

I want to get back to using 3DGS, now that the life calm down.

Anyway, would be happy in keep in touch with you 3DGS users.

Cheers from Mexico.
Posted By: Nems

Re: Anyone still using [newton] in some project ? - 08/14/13 02:18

Hi Carloos, just got back myself...

In randomly cruising thru various Dev forums, I quite often come across reference to Newton and folks who are still using it but I dont remeber which forums they were.
Still, they were all Game Dev related so perhaps unity, GameDev,Digital Tutors or Lynda.com might throw up something usefull....(only ones I can remember at the moment)
Posted By: Carloos

Re: Anyone still using [newton] in some project ? - 08/14/13 04:24

Hi Nems

Thats a lot of time I dont use 3DGS or newton or any other engine. I had a bad time today trying to work at newton 2.0 wrapper.
Its like to begin from zero again.
Would be nice to have a template with already a basic newton car example already set.
Next days will be searching researching and decinding if I will stick again with 3DGS or see if something else is an option.

Posted By: Carloos

Re: Anyone still using [newton] in some project ? - 08/14/13 17:25

Nobody else ?????
Posted By: sivan

Re: Anyone still using [newton] in some project ? - 08/15/13 11:22

Emre just posted his game, he is using A7 with Newton.
Posted By: Ch40zzC0d3r

Re: Anyone still using [newton] in some project ? - 08/15/13 11:36

Well, I used it for a very old game.
What is your problem? I didnt get it right I think.
My old wrapper is working^^

Also what engine could be an option?
Unity is for noobs who need an Interface ^^
I love 3DGS, JCL just needs to work on the WED instead of Zorro and 3DGS will be nice. Also if we get DirectX11 support this engine will get more popular laugh
Posted By: sivan

Re: Anyone still using [newton] in some project ? - 08/15/13 11:44

by the way, is Newtone better than NVidia PhysX? (I did some tests with PhysX, but never used Newton)
Posted By: Ch40zzC0d3r

Re: Anyone still using [newton] in some project ? - 08/15/13 11:53

Well, it depends...
I liked both but both also had errors.
So, PhysX is built in and due to this fact much better with events.
But newton has got less "bugs" on the main physics, so things dont actually pass the walls and I think the physics itself feels a little bit more real.
But all in all PhysX wins this fight because its built in laugh
Posted By: Wjbender

Re: Anyone still using [newton] in some project ? - 08/15/13 12:07

Newton game dynamics is a very cool physics sdk
in my oppinion , but hard to get everything wrapped for easy coding if your planning to do it yoyrself , i did my own newton implimentation along with scythe physics editor way back
into the irrlicht engine , i loved the physics and all
the possibilities it overed but when it comes to
time and eas of coding i guess physx is better as mentioned
Unless there is an existing wrapper wich offers
ease of use also
Posted By: Carloos

Re: Anyone still using [newton] in some project ? - 08/15/13 15:23

Oh, nice to see some life signals grin

Ch40zzC0d3r :

I also used it ( at 1.53 newton version ) for an old racing "game". I had problems at high speeds, cars roll very easy, so it was like impossible to achieve a racing speed and roll at high speed turns. I tweaked everything, no sucess in achieve something realistic.
Then I saw a vídeo ( that I dont find anymore ) from the Newton 2.0 and was a Indycar, and the speeds were very high with no roll problem at turns at all.

Sivan :

I second the other ones opinion. PhysX seems to be nice for being built in. But for racing games isnt that nice. Same roll or irreal that I had at Newton 1.53.

I got VeT´s Newton 2.x wrapper, but I´m having a bad time trying to make it work. NO collisions at all, no Physics at all. In the first sample of the wrapper, balls simply fall down and nothing happens. In the map101 ( vehicle ) example, the car also falls, the tyres dont stick to the car, and It gaves me lots of errors.

Thats a lot of time I dont use 3DGS, it´s being hard to understand what´s wrong.

Besides this, I´m thinking about begin using Ogre, thats far far more difficult to use. But I dont know If I will really spend a lot of time on it.

I like the 3DGS thing, and would love to stick with it.

I hope someone with more experience in Newton can help me in some way.
Posted By: Ch40zzC0d3r

Re: Anyone still using [newton] in some project ? - 08/15/13 16:05

I used Vets wrapper too, worked fine for me.
Didnt he inlcude some tutorials?
Just do it like there in your project.
Posted By: Carloos

Re: Anyone still using [newton] in some project ? - 08/15/13 16:19

Yes, he included the tutorials.

I´m mainly interested in the map101 ( vehicle tutorial ).

I made the changes to make it work on A8, but I get this error message :



I dont even imagine where to go after this error...
Posted By: Ch40zzC0d3r

Re: Anyone still using [newton] in some project ? - 08/15/13 16:22

well, would be awesome if you could post the error line and definition of JOINTLIBRARY_API here. But wth is dFloat? xD
Posted By: Carloos

Re: Anyone still using [newton] in some project ? - 08/15/13 16:36

well, I think its the NewtonJointLibrary.c file :

Quote:

// genetic joint functions
API (CustomDestroyJoint, jointlibrary)
API (CustomGetJointID, jointlibrary)
API (CustomSetJointID, jointlibrary)
API (CustomGetBody0, jointlibrary)
API (CustomGetBody1, jointlibrary)
API (CustomGetBodiesCollisionState, jointlibrary)
API (CustomSetBodiesCollisionState, jointlibrary)
API (CustomGetUserData, jointlibrary)
API (CustomSetUserData, jointlibrary)
API (CustomSetDestructorCallback, jointlibrary)
API (CustomSetSubmitContraintCallback, jointlibrary)

API(CustomCreateBlankJoint, jointlibrary)

// Kinematic control joint
API (CreateCustomKinematicController, jointlibrary)
API (CustomKinematicControllerSetPickMode, jointlibrary)
API (CustomKinematicControllerSetMaxLinearFriction, jointlibrary)
API (CustomKinematicControllerSetMaxAngularFriction, jointlibrary)
API (CustomKinematicControllerSetTargetPosit, jointlibrary)
API (CustomKinematicControllerSetTargetRotation, jointlibrary)
API (CustomKinematicControllerSetTargetMatrix, jointlibrary)
API (CustomKinematicControllerGetTargetMatrix, jointlibrary)

// Generic 6 degree of Freedom Joint
API (CreateCustomJoint6DOF, jointlibrary)
API (CustomJoint6DOF_SetLinearLimits, jointlibrary)
API (CustomJoint6DOF_SetAngularLimits, jointlibrary)
API (CustomJoint6DOF_GetLinearLimits, jointlibrary)
API (CustomJoint6DOF_GetAngularLimits, jointlibrary)
API (CustomJoint6DOF_SetReverseUniversal, jointlibrary)

// Interface for a custom BallAndSocket joint with Limits
API (CreateCustomBallAndSocket, jointlibrary)
API (BallAndSocketSetConeAngle, jointlibrary)
API (BallAndSocketSetTwistAngle, jointlibrary)

// Interface for a custom Hinge joint with Limits
API (CreateCustomHinge, jointlibrary)
API (HingeEnableLimits, jointlibrary)
API (HingeSetLimis, jointlibrary)

// Interface for a custom Slider joint with Limits
API (CreateCustomSlider, jointlibrary)
API (SliderEnableLimits, jointlibrary)
API (SliderSetLimis, jointlibrary)

// player controller functions
API (CreateCustomPlayerController, jointlibrary)
API (CustomPlayerControllerSetVelocity, jointlibrary)
API (CustomPlayerControllerGetVisualMaTrix, jointlibrary)
API (CustomPlayerControllerGetMaxSlope, jointlibrary)
API (CustomPlayerControllerSetMaxSlope, jointlibrary)
API (CustomPlayerControllerGetSensorShape, jointlibrary)

//// Multi rigid BodyCar controller functions
//API (CreateCustomMultiBodyVehicle, jointlibrary)
//API (CustomMultiBodyVehicleAddTire, jointlibrary)
//API (CustomMultiBodyVehicleAddSlipDifferencial, jointlibrary)
//API (CustomMultiBodyVehicleGetTiresCount, jointlibrary)
//API (CustomMultiBodyVehicleGetTireBody, jointlibrary)
//API (CustomMultiBodyVehicleGetSpeed, jointlibrary)
//API (CustomMultiBodyVehicleGetTireSteerAngle, jointlibrary)
//API (CustomMultiBodyVehicleApplyTorque, jointlibrary)
//API (CustomMultiBodyVehicleApplySteering, jointlibrary)
//API (CustomMultiBodyVehicleApplyBrake, jointlibrary)
//API (CustomMultiBodyVehicleApplyTireRollingDrag, jointlibrary)


//// BEGIN k00m (Dave Gravel simple raycast world vehicle)API
API (DGRaycastVehicleCreate, jointlibrary)
API (DGRaycastVehicleAddTire, jointlibrary)
API (DGRaycastVehicleSetTireTransformCallback, jointlibrary)
API (DGRaycastVehicleGetTiresCount, jointlibrary)
API (DGRaycastVehicleGetTiresUserData, jointlibrary)
API (DGRaycastVehicleGetTireMatrix, jointlibrary)
//API (DGRaycastVehicleGetSpeed, jointlibrary)
//API (DGRaycastVehicleGetTirePosit, jointlibrary)
//API (DGRaycastVehicleSetCustomTireBrake, jointlibrary)
//API (DGRaycastVehicleSetCustomTireTorque, jointlibrary)
//API (DGRaycastVehicleSetCustomTireSteerAngleForce, jointlibrary)
//API (DGRaycastVehicleGenerateTiresBrake, jointlibrary)
//API (DGRaycastVehicleGenerateTiresTorque, jointlibrary)
//API (DGRaycastVehicleGenerateTiresSteerForce, jointlibrary)
//API (DGRaycastVehicleGenerateTiresSteerAngle, jointlibrary)
//API (DGRaycastVehicleSetVarTireMovePointForceFront, jointlibrary)
//API (DGRaycastVehicleSetVarTireMovePointForceRight, jointlibrary)
//API (DGRaycastVehicleSetVarTireMovePointForceUp, jointlibrary)
//API (DGRaycastVehicleSetVarFixDeceleration, jointlibrary)
//API (DGRaycastVehicleSetVarChassisRotationLimit, jointlibrary)
//API (DGRaycastVehicleSetVarMaxSteerAngle, jointlibrary)
//API (DGRaycastVehicleSetVarMaxSteerRate, jointlibrary)
//API (DGRaycastVehicleSetVarMaxSteerForceRate, jointlibrary)
//API (DGRaycastVehicleSetVarMaxSteerForce, jointlibrary)
//API (DGRaycastVehicleSetVarMaxSteerSpeedRestriction, jointlibrary)
//API (DGRaycastVehicleSetVarMaxBrakeForce, jointlibrary)
//API (DGRaycastVehicleSetVarMaxTorque, jointlibrary)
//API (DGRaycastVehicleSetVarMaxTorqueRate, jointlibrary)
//API (DGRaycastVehicleSetVarEngineSteerDiv, jointlibrary)
//API (DGRaycastVehicleSetVarTireSuspenssionHardLimit, jointlibrary)
//API (DGRaycastVehicleSetVarTireFriction, jointlibrary)
//API (DGRaycastVehicleGetTiresCount, jointlibrary)
//API (DGRaycastVehicleGetVehicleOnAir, jointlibrary)
//API (DGRaycastVehicleGetTireOnAir, jointlibrary)
//API (DGRaycastVehicleDestroy, jointlibrary)
// END

//// Pick Body joint
//API (CreateCustomPickBody, jointlibrary)
//API (CustomPickBodySetPickMode, jointlibrary)
//API (CustomPickBodySetMaxLinearFriction, jointlibrary)
//API (CustomPickBodySetMaxAngularFriction, jointlibrary)
//API (CustomPickBodySetTargetRotation, jointlibrary)
//API (CustomPickBodySetTargetPosit, jointlibrary)
//API (CustomPickBodySetTargetMatrix, jointlibrary)
//API (CustomPickBodyGetTargetMatrix, jointlibrary)


/* */


Sorry if I dont know what i´m talking about.

And this is the complete code of map101.c :
Quote:

float temp_float;

ENTITY* FLwheelPtr;
ENTITY* FRwheelPtr;
ENTITY* BLwheelPtr;
ENTITY* BRwheelPtr;
ENTITY* tireId;
ENTITY* tireModel;
ENTITY* car;

D3DXMATRIX m;

action solid()
{
c_setminmax(me);
set(my,POLYGON);
vec_set(my.scale_x,vector(2,2,2));
my.flags |= FLAG8;
}

action Newton_Car()
{
int tireMass = 30;
float suspensionLength = 0.25;
float suspensionSpring =700.0;
float suspensionShock = 60.0;
float wheelradius = 0.4;
float tirePin[3] = {0.0, 1.0, 0.0};
D3DXMATRIX tire_offset;
D3DXMATRIX tire_offset1;
D3DXMATRIX tire_offset2;
D3DXMATRIX tire_offset3;
D3DXMATRIX tire_offset4;
VECTOR tirepos;

car = me;
vec_set(my.pan,vector(180,0,0));
wait(3);

NewtonBody* car_body = newton_addentity(me, 130, NEWTON_CONVEXHULL, onforceandtorque);
NewtonBodySetAutoSleep( car_body, 0);
NewtonBodySetLinearDamping(car_body,0.005);

D3DXMATRIX tire_offset;
NewtonBodyGetMatrix(car_body,&tire_offset);

float tire_offset[16] = {0,0,1,0, 0,1,0,0, -1,0,0,0, 0,0,0,1};
float tire_offset[16] = {1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1};
float tire_offset[16] = {0,1,0,0, 0,0,1,0, 1,0,0,0, 0,0,0,1};

NewtonJoint* car_joint = DGRaycastVehicleCreate(4, tire_offset, car_body);

DGRaycastVehicleAddTire(car_joint,NULL,vector(5,-5,-1), 0.5, 1, 1, 0.1, 2, 70, 5, 1);
DGRaycastVehicleAddTire(car_joint,NULL,vector(5,5,-1), 0.5, 1, 1, 0.1, 2, 70, 5, 1);
DGRaycastVehicleAddTire(car_joint,NULL,vector(-5,5,-1), 0.5, 1, 1, 0.1, 2, 70, 5, 1);
DGRaycastVehicleAddTire(car_joint,NULL,vector(-5,-5,-1), 0.5, 1, 1, 0.1, 2, 70, 5, 1);

FLwheelPtr = ent_create("WheelL.mdl",nullvector,NULL);
FRwheelPtr = ent_create("WheelR.mdl",nullvector,NULL);
BLwheelPtr = ent_create("WheelL.mdl",nullvector,NULL);
BRwheelPtr = ent_create("WheelR.mdl",nullvector,NULL);

vec_set(tirepos,vector(20,-20,-20));
D3DXMatrixTranslation(&tire_offset1, tirepos.x ,tirepos.y ,tirepos.z );

DGRaycastVehicleAddTire(car_joint,FLwheelPtr,&tire_offset, 0.5, 0.1, 1, 0.1, 0.25, 70, 5, 1);

JOINTLIBRARY_API void DGRaycastVehicleAddTire(NewtonCustomJoint *car, void *userData, const dFloat* localPosition, dFloat mass, dFloat radius, dFloat width, dFloat friction, dFloat suspensionLength, dFloat springConst, dFloat springDamper, int castMode);

vec_set(tirepos,vector(20,20,-20));
D3DXMatrixTranslation(&tire_offset1, tirepos.x * QUANTTOMETER,tirepos.y * QUANTTOMETER,tirepos.z * QUANTTOMETER);
D3DXMatrixTranslation(&tire_offset1, tirepos.x ,tirepos.y,tirepos.z );
DGRaycastVehicleAddTire(car_joint,FRwheelPtr,&tire_offset,20,55,0.3,1.1,0.25,60,5,1);

vec_set(tirepos,vector(-20,-20,-20));
D3DXMatrixTranslation(&tire_offset1, tirepos.x * QUANTTOMETER,tirepos.y * QUANTTOMETER,tirepos.z * QUANTTOMETER);
D3DXMatrixTranslation(&tire_offset1, tirepos.x ,tirepos.y ,tirepos.z );
DGRaycastVehicleAddTire(car_joint,BLwheelPtr,&tire_offset,20,55,0.3,1.1,0.25,60,5,1);

vec_set(tirepos,vector(-20,-20,-20));
D3DXMatrixTranslation(&tire_offset1, tirepos.x * QUANTTOMETER,tirepos.y * QUANTTOMETER,tirepos.z * QUANTTOMETER);
D3DXMatrixTranslation(&tire_offset1, tirepos.x ,tirepos.y ,tirepos.z);
DGRaycastVehicleAddTire(car_joint,BRwheelPtr,&tire_offset,20,55,0.3,1.1,0.25,60,5,1);



FLwheelPtr = ent_create("WheelR.mdl",vector(0,0,-500),NULL);
vec_for_bone(tirepos,me,"FRBone");
vec_sub(tirepos,my.x);
D3DXMatrixTranslation(&tire_offset2, tirepos.x * QUANTTOMETER,tirepos.y * QUANTTOMETER,tirepos.z * QUANTTOMETER);
DGRaycastVehicleAddTire(car_joint,FRwheelPtr,&tire_offset2,20,0.35,0.3,1.1,0.25,60,5,1);

FLwheelPtr = ent_create("WheelL.mdl",vector(0,0,-500),NULL);
vec_for_bone(tirepos,me,"BLBone");
vec_sub(tirepos,my.x);
D3DXMatrixTranslation(&tire_offset3, tirepos.x * QUANTTOMETER,tirepos.y * QUANTTOMETER,tirepos.z * QUANTTOMETER);
DGRaycastVehicleAddTire(car_joint,BLwheelPtr,&tire_offset3,20,0.35,0.3,1.1,0.25,60,5,1);

FLwheelPtr = ent_create("WheelR.mdl",vector(0,0,-500),NULL);
vec_for_bone(tirepos,me,"BRBone");
vec_sub(tirepos,my.x);
D3DXMatrixTranslation(&tire_offset4, tirepos.x * QUANTTOMETER,tirepos.y * QUANTTOMETER,tirepos.z * QUANTTOMETER);
DGRaycastVehicleAddTire(car_joint,BRwheelPtr,&tire_offset4,20,0.35,0.3,1.1,0.25,60,5,1);

FLwheelPtr = ent_create("tekerlekL.mdl",nullvector,NULL);

vec_for_bone(tirepos,me,"FLBone");
vec_sub(tirepos,my.x);
D3DXMatrixTranslation(&tire_offset, tirepos.x * QUANTTOMETER,tirepos.y * QUANTTOMETER,tirepos.z * QUANTTOMETER);
NewtonVehicleAddTire(car_joint, &tire_offset, tirePin[0], tireMass, wheelradius, wheelradius, suspensionShock,suspensionSpring,suspensionLength, FLwheelPtr, 5);

tPos = rv_Tires[i].rt_Mesh->ob_Matrix.m_posit;
DGRaycastVehicleAddTire(car_joint,FLwheelPtr,
&tire_offset,
20, //rv_Tires[i].rt_Mass,
0.35, //rv_Tires[i].rt_Radius,
0.3, //rv_Tires[i].rt_Width,
1.1, //rv_Tires[i].rt_Friction,
0.25, //rv_Tires[i].rt_SuspensionLenght,
60, //rv_Tires[i].rt_SuspensionConst,
5, //rv_Tires[i].rt_SuspensionDamping,
1 //rv_CastMode
);



FRwheelPtr = ent_create("tekerlekR.mdl",nullvector,NULL);
BLwheelPtr = ent_create("tekerlekL.mdl",nullvector,NULL);
BRwheelPtr = ent_create("tekerlekR.mdl",nullvector,NULL);



while(car != NULL)
{
// /*
// // SET ALL TIRES POSITION AND ANGLE [ THESE LINES ARE NOT AT TIRE CALLBACK FUNC. BECAUSE MAKING THAT CAUSES VISUAL TIRES TO UPDATE 1 FRAME LATER THAN NEWTON TIRES ]
for (tireId = NewtonVehicleGetFirstTireID (car_joint); tireId!=NULL; tireId = NewtonVehicleGetNextTireID (car_joint, tireId))
{
tireModel = NewtonVehicleGetTireUserData (car_joint, tireId);
NewtonVehicleGetTireMatrix(car_joint,tireId, m);
ent_setmatrix_rb(tireModel,m);
}
//
DGRaycastVehicleSetCustomTireTorque(car_joint,1,1500);
DGRaycastVehicleSetCustomTireTorque(car_joint,0,1500);

car_camera_move();

wait(1);
}
}
Posted By: Carloos

Re: Anyone still using [newton] in some project ? - 08/15/13 16:38

As I remember reading somewhere in the Newton wrapper post, a dFloat is merely a Float.
Posted By: Ch40zzC0d3r

Re: Anyone still using [newton] in some project ? - 08/15/13 17:02

Well, please tell me what the definition of the function does in another function xD
Put it global!
Also you call 1 line before you actually define the function this function ^^
Posted By: Carloos

Re: Anyone still using [newton] in some project ? - 08/15/13 17:07

Well, I dont know... Just uncommented the lines and try to mame it run... ould you please point me where exactly where / what are these errors ?
Posted By: Ch40zzC0d3r

Re: Anyone still using [newton] in some project ? - 08/15/13 17:36

I talked about the second codebox where you marked the line in red. Place it BEFORE the function ^^
Posted By: Carloos

Re: Anyone still using [newton] in some project ? - 08/15/13 17:52

Well, now that you pointed this, I see that this "looks" like dont belong to this script.

Interesting that I just uncommented the lines, everything is like was at the original script.

Placing it before the action ( action ??? ) doesnt make difference, it gaves the same error, just changing the line.
Posted By: Carloos

Re: Anyone still using [newton] in some project ? - 08/15/13 17:54

would you be interested in a more close look at this ? I can zip everything and send to my "website" then you can grab it and give a look.
Posted By: Ch40zzC0d3r

Re: Anyone still using [newton] in some project ? - 08/15/13 18:11

yes why not grin
Please zip everything how it was when you downloaded it, I will try to fix it laugh
Posted By: Carloos

Re: Anyone still using [newton] in some project ? - 08/15/13 18:20

Uploaded :

Download link

Its just the wrapper from Vet, I just uploaded it to my website, anyway, its easier then the depositfiles original thing.
Posted By: Ch40zzC0d3r

Re: Anyone still using [newton] in some project ? - 08/15/13 18:48

So, here it is, working collision laugh
But the car hasnt got tires you know? xD

DL: http://www.mediafire.com/?77oh88ekuaa0kvu
Posted By: Carloos

Re: Anyone still using [newton] in some project ? - 08/15/13 19:22

yes, I saw that... but I see also the tyres are there, they just dont stick to the car body.

Maybe I´m missing something very elementar at my A8 + Newton Setup frown

Even the first map doenst work...
Posted By: Ch40zzC0d3r

Re: Anyone still using [newton] in some project ? - 08/15/13 19:56

Uhm, my fix works fine for me shocked
Posted By: Carloos

Re: Anyone still using [newton] in some project ? - 08/15/13 19:59

Straaange....

What exact changes did u made ?
Posted By: Carloos

Re: Anyone still using [newton] in some project ? - 08/16/13 03:09

hummm it looks like the vehicle example isn´t finished frown
Posted By: Carloos

Re: Anyone still using [newton] in some project ? - 08/16/13 16:39

How difficult would be to finish this wrapper ?
Posted By: Ch40zzC0d3r

Re: Anyone still using [newton] in some project ? - 08/16/13 16:43

Difficult for me, not very hard for the author since he knows the code.
Posted By: Carloos

Re: Anyone still using [newton] in some project ? - 08/16/13 16:58

I sent him a PM some days ago. Till now, no response...
© 2024 lite-C Forums