Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by Zheka. 06/20/24 14:26
Lapsa's very own thread
by rki. 06/19/24 11:27
A simple game ...
by VoroneTZ. 06/18/24 10:50
Face player all the time ...
by bbn1982. 06/18/24 10:25
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,320 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Mino, squik, AemStones, LucasJoshua, Baklazhan
19061 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Perpendicular collision stops ball #339190
08/25/10 08:40
08/25/10 08:40
Joined: Aug 2010
Posts: 26
J
JHA Offline OP
Newbie
JHA  Offline OP
Newbie
J

Joined: Aug 2010
Posts: 26
Hello
Using physics engine to create ball:

VECTOR BulletPos;
VECTOR vKick;

vec_set(BulletPos.x,camera.x);

eBall = ent_create("ball.mdl",BulletPos,NULL);
set(eBall,SHADOW);
eBall.material = mat_metal;
phent_settype(eBall,PH_RIGID,PH_SPHERE);
phent_setmass(eBall,1,PH_SPHERE);
phent_setfriction(eBall,90);
phent_setelasticity(eBall,85,100);
phent_setdamping(eBall,30,5);

vec_for_angle(vKick.x,camera.pan);

vec_scale(vKick,1000);
phent_addvelcentral(eBall,vKick);

attaching this function to keyboard and when pressing the key, key "shoots" nicely ball to the direction of camera. The only problem is that if ball hits perpendicular (about 90 degrees) to mountain or if I drop it directly towards ground the ball gets stucked and can be there several seconds and then suddenly bounces off. If there is less angle like 45, ball never gets stucked. Any idea how to get rid of this problem. Sed version number is 7.36.1 and engine is v7.86.2 commercial edition.

Can anyone help

Re: Perpendicular collision stops ball [Re: JHA] #340089
08/31/10 18:26
08/31/10 18:26
Joined: Aug 2010
Posts: 26
J
JHA Offline OP
Newbie
JHA  Offline OP
Newbie
J

Joined: Aug 2010
Posts: 26
I was able to solve this by setting parameters of physics engine, no need to answer this.

Re: Perpendicular collision stops ball [Re: JHA] #340092
08/31/10 18:43
08/31/10 18:43
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
small hint:
use a8 for physic s projects!
those projects are with PhysX and much more easier to handle


Visit my site: www.masterq32.de

Moderated by  HeelX, Spirit 

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