Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (AndrewAMD, TipmyPip, OptimusPrime), 15,229 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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 | 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