Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (Akow), 689 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
[solved] Wrong collision with hole of torus in POLYGON mode #358335
02/10/11 20:00
02/10/11 20:00
Joined: Nov 2010
Posts: 96
Vienna
S
Schubido Offline OP
Junior Member
Schubido  Offline OP
Junior Member
S

Joined: Nov 2010
Posts: 96
Vienna
Hi,

I found a strange collision behaviour in POLYGON mode.
This sample shows the effect

Code:
#include <acknex.h>

ENTITY* torus;
ENTITY* sphere;

action rotate_torus()
{
	while(1)
	{
		c_rotate(me,vector(time_step,0,0),NULL);
		wait(1);
	}	
}

action move_sphere()
{
	while(1)
	{
		me.y-=time_step*(key_cur-key_cul);
		wait(1);
	}	
}

function main()
{
	level_load(NULL);
	torus = ent_create("torus.mdl",nullvector,rotate_torus);
	torus.emask |= ENABLE_IMPACT|ENABLE_PUSH;
	set(torus,POLYGON);
	vec_scale(torus.scale_x,10);
	sphere = ent_create("sphere.mdl", nullvector, move_sphere);
	c_setminmax(sphere);
	camera.x = -500;
}



The torus should rotate, but it stucks as long as the sphere is in the center of the torus. If it's moved away from the center with the arrow keys (but still within torus), rotation starts.

So the empty space in the torus triggers a collision. Seems as if the center point is checked for collision when rotating (maybe also when moving).

The models in this sampe are MED - standard size torus and sphere.

Last edited by Schubido; 02/11/11 09:58. Reason: has been clarified
Re: Wrong collision with hole of torus in POLYGON mode [Re: Schubido] #358356
02/10/11 21:21
02/10/11 21:21
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
POLYGON does not have any effect for the moving/ rotating object.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Wrong collision with hole of torus in POLYGON mode [Re: Superku] #358392
02/10/11 23:56
02/10/11 23:56
Joined: Nov 2010
Posts: 96
Vienna
S
Schubido Offline OP
Junior Member
Schubido  Offline OP
Junior Member
S

Joined: Nov 2010
Posts: 96
Vienna
That means in a model which is moved the bounding box is used for collision detection regardless if POLYGON is set? Well, I read in the manual that I should not do what I'm doing, but I did not get why. Now got it.
But to be honest, I don't like your answer, because it shows me that it is my personal issue and I can't blame anyone else ;-)

Thanks for help - it kept me awake longer than planned, but already found a feasible work around to get what I need.


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