Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [bug] 2.0.19 CreateObjectFromObjectMesh

Author
Message
Preben
AGK Studio Developer
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 31st May 2016 11:45
No collision data is created when using CreateObjectFromObjectMesh.

test:
ggobjectid[ml] = LoadObjectWithChildren( “/gameguru/entitybank/Foliage/palm06.x” )
ggmedialod2id[ml] = CreateObjectFromObjectMesh( ggobjectid[ml],2 )

New object look fine but collision do not work.
best regards Preben Eriksen,
Preben
AGK Studio Developer
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 10th Jun 2016 13:21
bump
best regards Preben Eriksen,
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 15th Jun 2016 13:42
I had a look but the command to generate collision data is begin called, so it is likely something specific with the model. Do you have an example I can test?
Preben
AGK Studio Developer
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 17th Jun 2016 10:24
Thanks , i did some more test and noticed that this is not only related to CreateObjectFromObjectMesh , but to any objects if you do it like this:

obj = CreateObjectFromObjectMesh( ggobjectid[ml],2 )
SetObjectCollisionMode( obj , 0)
testobj = InstanceObject( obj )

After this there is no way to enable coillision on testobj , even if you enable collison on both obj and testobj , coillision will never work.

I will just enable collision before Instance so its not really a problem. but perhaps you should generate the collision data ( if not already set ) when SetObjectCollisionMode( testobj ,1) is called

best regards Preben Eriksen,
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 17th Jun 2016 14:28
I can't replicate it with this code


However I did find a bug in CreateObjectFromObjectMesh where the created object would not draw properly, fixed for the next version, but this didn't affect collision.
Preben
AGK Studio Developer
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 27th Jun 2016 11:07
It has something to do with disabling collision and using SetObjectScalePermanent:



If you remove SetObjectScalePermanent in the sample above , then collision is working on object 2 ?

best regards Preben Eriksen,
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 27th Jun 2016 13:32
Fixed for the next version. SetObjectScalePermanent caused a regeneration of the collision data, but since the collision is set to 0 at this point it skips that step and leaves the object with no collision data. Only a call to SetObjectCollisionMode on the original object would regenerate the collision data so the instance object had no data to check. Now calling SetObjectCollisionMode on an instance will also regenerate the collision data on the parent if necessary.

Login to post a reply

Server time is: 2024-11-25 06:43:42
Your offset time is: 2024-11-25 06:43:42