Gamestudio Links
Zorro Links
Newest Posts
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
M1 Oversampling
by 11honza11. 04/20/24 20:57
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (rki, AndrewAMD), 426 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 5
Page 7 of 16 1 2 5 6 7 8 9 15 16
Re: newton [Re: Sam_Be] #113101
10/23/07 13:46
10/23/07 13:46
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline

Serious User
VeT  Offline

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: newton [Re: Sam_Be] #113102
10/23/07 16:16
10/23/07 16:16
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline

Serious User
VeT  Offline

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
okay, looking like working... :-)
now, question about upVector

when i add
Code:
  
NewtonJoint* m_upVector;
m_upVector = NewtonConstraintCreateUpVector (nworld, vector(0,1,0), MH.NewtonChar);


, model falls down through floor...


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: newton [Re: VeT] #113103
10/23/07 19:48
10/23/07 19:48
Joined: Oct 2006
Posts: 873
S
Shadow969 Offline
User
Shadow969  Offline
User
S

Joined: Oct 2006
Posts: 873
hey VeT
looks like you've defined a hinge wrong, if i remember correct you have to convert vector somehow. You may check my hinges example

Re: newton [Re: Shadow969] #113104
10/24/07 07:17
10/24/07 07:17
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline

Serious User
VeT  Offline

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
greetings :-D
okay, i'd look to your example


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: newton [Re: VeT] #113105
10/29/07 17:33
10/29/07 17:33
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
sometimes the question comes up how to do phent_addforceglobal()/phent_addforcelocal() with newton.

here is a short (untested) code snippet:
Code:
newton_bodyaddforceglobal(NewtonBody *body, VECTOR *force, VECTOR *point) // add force at point in global coordinate system
{
ENTITY *entity = (ENTITY*)NewtonBodyGetUserData(body);
VECTOR r, torque;
vec_diff(r, point, entity->x);
vec_cross(torque, r, force);
NewtonBodyAddForce(body, force);
NewtonBodyAddTorque(body, torque);
}

newton_bodyaddforcelocal(NewtonBody *body, VECTOR *force, VECTOR *point) // add force at point in entity coordinate system
{
ENTITY *entity = (ENTITY*)NewtonBodyGetUserData(body);
VECTOR globalforce, globalpoint;
vec_set(globalforce, force);
vec_set(globalpoint, point);
vec_rotate(globalforce, entity->pan);
vec_rotate(globalpoint, entity->pan);
vec_add(globalpoint, entity->x);
newton_bodyaddforceglobal(globalforce, globalpoint);
}



i think lite-c still doesn't come with a vec_cross() function so you have to do one yourself.

(...and i guess you also should apply QUANTTOMETER in those functions.)

Re: newton [Re: ventilator] #113106
10/29/07 19:48
10/29/07 19:48
Joined: Apr 2004
Posts: 44
S
Stelynn Offline
Newbie
Stelynn  Offline
Newbie
S

Joined: Apr 2004
Posts: 44
Has anyone tried to set up a Material system and implement a water block.

Re: newton [Re: Stelynn] #113107
10/29/07 20:06
10/29/07 20:06
Joined: Oct 2006
Posts: 873
S
Shadow969 Offline
User
Shadow969  Offline
User
S

Joined: Oct 2006
Posts: 873
i tried materials way back, but some newton function crashed all the time. maybe i'll try again later

Re: newton [Re: Shadow969] #113108
10/31/07 19:08
10/31/07 19:08
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline

Serious User
VeT  Offline

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
and what about NewtonBodyGetVelocity?
in debug panel, there are always zeros... so i tried

NewtonBodyGetVelocity(MH.NewtonChar,vectorf(temp_vec2.x,temp_vec2.y,temp_vec2.z));
NewtonBodySetVelocity(MH.NewtonChar,vectorf(temp_vec2.x,temp_vec2.y,temp_vec2.z));

primary, this code mustnd do anything... but in real this works like
NewtonBodySetVelocity(MH.NewtonChar,vectorf(nullvector));

so, how can i get the speed of entity?


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: newton [Re: VeT] #113109
10/31/07 19:15
10/31/07 19:15
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
vectorf() doesn't make sense for getvelocity since it just returns a temporary pointer which you can't really access afterwards.

try this:

float velocity[3];
NewtonBodyGetVelocity(MH.NewtonChar, velocity);
temp_vec2.x = velocity[0];
temp_vec2.y = velocity[1];
temp_vec2.z = velocity[2];

Re: newton [Re: ventilator] #113110
10/31/07 19:26
10/31/07 19:26
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline

Serious User
VeT  Offline

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
yeah, thanks, that's it :-)


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Page 7 of 16 1 2 5 6 7 8 9 15 16

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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