Gamestudio Links
Zorro Links
Newest Posts
folder management functions
by 7th_zorro. 04/16/24 13:19
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
LPDIRECT3DCUBETEXTUR
E9

by Ayumi. 04/12/24 11:00
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 04/11/24 14:56
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (rki, Ayumi, Quad), 490 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
11honza11, ccorrea, sakolin, rajesh7827, juergen_wue
19045 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 5
Page 9 of 16 1 2 7 8 9 10 11 15 16
Re: newton [Re: VeT] #113121
11/04/07 17:51
11/04/07 17:51
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
omega is the angular velocity. i wouldn't set that. i would try to apply a torque. but i don't really see what's wrong with your example. maybe you can show a simple demo.

Re: newton [Re: ventilator] #113122
11/04/07 17:55
11/04/07 17:55
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline

Serious User
VeT  Offline

Serious User

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

with moving characters



i can say, l'm just moving simple objects, called character ;-)))


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] #113123
11/04/07 18:17
11/04/07 18: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
okay, here it is

Code:
 void MHonforceandtorque(NewtonBody* body)
{
float mass, ixx, iyy, izz;
NewtonBodyGetMassMatrix(body, &mass, &ixx, &iyy, &izz);
NewtonBodySetAutoFreeze (MH.NewtonChar, 0);

vec_set(temp_vec,vector(MH.keyX*100, MH.keyY*100,-mass*5));
vec_rotate(temp_vec,MH.model.pan);
NewtonBodySetForce(MH.NewtonChar,vectorf(temp_vec.x,temp_vec.y,temp_vec.z));

// damping
NewtonBodySetLinearDamping (MH.NewtonChar, 0.9);

// rotating
NewtonBodySetOmega(MH.NewtonChar, vectorf(0,0,-MH.mouseX*5));

// // speed limit
NewtonBodyGetVelocity(MH.NewtonChar, velocity);
temp_vec2.x = velocity[0];
temp_vec2.y = velocity[1];
temp_vec2.z = velocity[2];
// NewtonBodySetVelocity(MH.NewtonChar,vectorf(temp_vec2.x,temp_vec2.y,temp_vec2.z));

}

function player_init()
{
// MH.model = me;
MH.handler = handle(MH.model);
MH.NewtonChar = newton_addentity(MH.model, 10, NEWTON_SPHERE, MHonforceandtorque);

NewtonBodySetMassMatrix (MH.NewtonChar, 10.0, 10.0, 10.0, 10.0);

NewtonBodySetAngularDamping (MH.NewtonChar, vector(100,100,100));
}






PS:i use omega to move entity exactly as mouse moves ;-)

Last edited by VeT; 11/04/07 18:24.

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] #113124
11/04/07 18:36
11/04/07 18:36
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
some things i noticed:
- the mass matrix already gets set in newton_addentity().
- be careful with vector()/vectorf(). newton doesn't work with vars.
- i think if your "character" is a rolling sphere then it doesn't really make sense to rotate your steering force like that. or does setomega block all rotation?

it's hard to say... maybe someone else has ideas.

Re: newton [Re: ventilator] #113125
11/04/07 18:49
11/04/07 18:49
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline

Serious User
VeT  Offline

Serious User

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

1) i played with matrix, because i need to make low center of mass
2) i'd look, where sphere points, but i dont think that this is the main problem

i set angular velocity just for normal reaction at mouse... if i'd use angular force, entity would rotate for too large angle

Last edited by VeT; 11/04/07 18:54.

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] #113126
11/04/07 19:40
11/04/07 19:40
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline

Serious User
VeT  Offline

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
debug shows that sphere looks in right position...
red line is looking straight ahead, so problem isnt here

so, i'd try to explain problem more exactly:
- i press W, body moves forward...
- if i allow body to stop, and then press A, body strafes normal
- BUT if i dont allow it(for example, press W, press A, unperss W), body moves forvard-left... it's looks like forward force still working, but
Code:

vec_set(temp_vec,vector(MH.keyX*100, MH.keyY*100,-mass*5));


and MH.keyX = (key_pressed(17) - key_pressed(31));

so, force =0, if W isnt pushed...
thats main trouble :-(

anyway, ventilator, thank you very much for help... i'd add you to credits :-D

Last edited by VeT; 11/04/07 20:09.

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] #113127
11/06/07 16:44
11/06/07 16:44
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline

Serious User
VeT  Offline

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
new trouble :-(
F11 shows 100-110 FPS, but entity moves looking like there are only 5-10 FPS... does everyone have the same problem?


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] #113128
11/06/07 18:50
11/06/07 18:50
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
no, i don't have the "looks like 10fps" problem. i am out of ideas. maybe someone can help if you give a clear description of what you want to achieve and provide a small test level so that we see the problem and can experiment.

Re: newton [Re: ventilator] #113129
11/06/07 20:05
11/06/07 20:05
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline

Serious User
VeT  Offline

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
i found that i get this bug only at my machine... plus i get idea, what to do with "W+A"


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] #113130
11/17/07 18:56
11/17/07 18:56
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, i deal with almost all problems... but still dont have and ideas about upvector

can somebody give a working example of this: my always falls down through the 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
Page 9 of 16 1 2 7 8 9 10 11 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