Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (degenerate_762), 1,128 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: Anyone still using [newton] in some project ? [Re: Carloos] #427940
08/15/13 16:05
08/15/13 16:05
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
I used Vets wrapper too, worked fine for me.
Didnt he inlcude some tutorials?
Just do it like there in your project.

Re: Anyone still using [newton] in some project ? [Re: Ch40zzC0d3r] #427942
08/15/13 16:19
08/15/13 16:19
Joined: Mar 2005
Posts: 514
Brazil
Carloos Offline OP
User
Carloos  Offline OP
User

Joined: Mar 2005
Posts: 514
Brazil
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...

Re: Anyone still using [newton] in some project ? [Re: Carloos] #427943
08/15/13 16:22
08/15/13 16:22
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
well, would be awesome if you could post the error line and definition of JOINTLIBRARY_API here. But wth is dFloat? xD

Re: Anyone still using [newton] in some project ? [Re: Ch40zzC0d3r] #427945
08/15/13 16:36
08/15/13 16:36
Joined: Mar 2005
Posts: 514
Brazil
Carloos Offline OP
User
Carloos  Offline OP
User

Joined: Mar 2005
Posts: 514
Brazil
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);
}
}

Last edited by Carloos; 08/15/13 16:37.
Re: Anyone still using [newton] in some project ? [Re: Carloos] #427946
08/15/13 16:38
08/15/13 16:38
Joined: Mar 2005
Posts: 514
Brazil
Carloos Offline OP
User
Carloos  Offline OP
User

Joined: Mar 2005
Posts: 514
Brazil
As I remember reading somewhere in the Newton wrapper post, a dFloat is merely a Float.

Re: Anyone still using [newton] in some project ? [Re: Carloos] #427949
08/15/13 17:02
08/15/13 17:02
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
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 ^^

Last edited by Ch40zzC0d3r; 08/15/13 17:02.
Re: Anyone still using [newton] in some project ? [Re: Ch40zzC0d3r] #427950
08/15/13 17:07
08/15/13 17:07
Joined: Mar 2005
Posts: 514
Brazil
Carloos Offline OP
User
Carloos  Offline OP
User

Joined: Mar 2005
Posts: 514
Brazil
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 ?

Re: Anyone still using [newton] in some project ? [Re: Carloos] #427951
08/15/13 17:36
08/15/13 17:36
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
I talked about the second codebox where you marked the line in red. Place it BEFORE the function ^^

Re: Anyone still using [newton] in some project ? [Re: Ch40zzC0d3r] #427952
08/15/13 17:52
08/15/13 17:52
Joined: Mar 2005
Posts: 514
Brazil
Carloos Offline OP
User
Carloos  Offline OP
User

Joined: Mar 2005
Posts: 514
Brazil
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.

Re: Anyone still using [newton] in some project ? [Re: Carloos] #427953
08/15/13 17:54
08/15/13 17:54
Joined: Mar 2005
Posts: 514
Brazil
Carloos Offline OP
User
Carloos  Offline OP
User

Joined: Mar 2005
Posts: 514
Brazil
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.

Page 2 of 3 1 2 3

Moderated by  aztec, Blink, HeelX 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1