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.16 : LoadObjectWithChildren() and SetObjectScale(), instance/clone...

Author
Message
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 14th Jan 2016 16:45
Hi

It seems there are some bug with LoadObjectWithChildren() and SetObjectScale(), with an animated model in *.dae.

1) LoadObjectWithChildren() and SetObjectScale()

With SetObjectScale(), the model is very deformed :


With SetObjectScalePermanent(), the model is normal, but I can't use instanceObject()/CloneObject() with LoadObjectWithChildren() :




2) LoadObjectWithChildren() doesn't work with : InstanceObject() or cloneObject()

If I try to clone/instance an object, the cloned/instancied object doesn't appear if I use : LoadObjectWithChildren() and SetObjectScalePermanent().

LoadObjectWithChildren(1,file$)
SetObjectScalePermanent(1,10,10,10)
PlayObjectAnimation(1, "", 0, 2, 1, 0)

InstanceObject(2,1) // doesn't work (object doesn't appears
CloneObject(2,1) // doesn't work (object doesn't appears

Code example :
AGK2 tier1 - http://www.dracaena-studio.com
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 14th Jan 2016 19:07 Edited at: 14th Jan 2016 19:13
Thanks, fixed for the next version. The bug was caused by the bone bounding boxes not being setup properly, so using SetObjectScreenCulling to disable culling on the instance/clone could be used as a workaround.

Quote: "1) LoadObjectWithChildren() and SetObjectScale()
With SetObjectScale(), the model is very deformed : "

Unfortunately SetObjectScale is not designed to work on animated objects. Due to the hierarchies involved the scaling gets distorted across the bones, so only SetObjectScalePermanent will work, which modifies the vertices instead of the transform matrices.
Shizki
21
Years of Service
User Offline
Joined: 24th Apr 2003
Location: UK
Posted: 2nd Apr 2016 11:30
CloneObject() doesn't seem to copy the animation when cloning an object that was created using LoadObjectWithChildren(). Is this a bug or by design?
xCept
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 3rd Apr 2016 00:49
I have also found that raycasts do not seem to detect models (at least animated ones, possibly static as well) that are in at least a couple formats, .FBX being one and maybe .X the other. I don't have sample code worked up right now but when experimenting with it I found that the same exact model exported in another format would receive raycasts, but these formats would not so there was no good way to 'pick' objects with mouse, etc.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 3rd Apr 2016 01:52
Quote: "I have also found that raycasts do not seem to detect models "


I wonder if this is the issue I'm having here. I'm using .X and .dae physics objects.
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 6th Apr 2016 16:45
Quote: "CloneObject() doesn't seem to copy the animation when cloning an object that was created using LoadObjectWithChildren(). Is this a bug or by design?"

Tested using the BoneAnimation example that comes with AppGameKit and I can't replicate this. Using CloneObject and then PlayObjectAnimation plays the animation on the cloned object.

Quote: "I have also found that raycasts do not seem to detect models (at least animated ones, possibly static as well) that are in at least a couple formats, .FBX being one and maybe .X the other."

For animated objects the ray casts only check the bind pose for collision, I need to modify it to check the bone bounding boxes at some point. However it should work equally on all model formats, if you can find a difference between the behaviour of one format versus another please post an example so I can take a look.

Login to post a reply

Server time is: 2024-11-25 08:56:06
Your offset time is: 2024-11-25 08:56:06