RecalculateMapBounds in combination with bones



Users browsing this forum: No registered users and 1 guest

Next topic
Previous topic
Post new topic Reply to topic  NeoAxis Forum Index » General » Bugs
Search for:
Author Message
Professional License
Professional License

Joined: Mon Nov 10, 2008
Posts: 116
Location: germany->bavaria->franconia
PostPosted: Mon Apr 13, 2009 9:02 pm Post subject: RecalculateMapBounds in combination with bones
Bottom of Page Back to top
I'm trying to update the bounds of a MapObject after i changed position and rotation of bones from an attached mesh. But RecalculateMapBounds does not consider that the size/direction of the mesh has changed.

_________________
Visit my Site: www.chris-a.de .
"there are only 10 types of people in the world: those who understand binary, and those who don't."
 
 Profile  
Professional License
Professional License

Joined: Mon Nov 10, 2008
Posts: 116
Location: germany->bavaria->franconia
PostPosted: Fri Apr 17, 2009 11:17 am 
Bottom of Page Back to top
I've now tried to use MapBounds.Add or MapBounds.Expand, both are not changing the Bounds. MapBounds.Minimum and MapBounds.Maximum stay the same. Settings MapBounds to a new instance is not allowed, so how can i correct MapBounds?

_________________
Visit my Site: www.chris-a.de .
"there are only 10 types of people in the world: those who understand binary, and those who don't."
 
 Profile  
Professional License
Professional License

Joined: Tue Jul 10, 2007
Posts: 396
PostPosted: Fri Apr 17, 2009 11:29 am 
Bottom of Page Back to top
I am interested in this one too. It causes me some trouble for runtime-created mesh that change shapes.
Freeman

_________________
Freeman
 
 Profile  
Professional License
Professional License

Joined: Mon Nov 10, 2008
Posts: 116
Location: germany->bavaria->franconia
PostPosted: Fri Apr 17, 2009 11:43 am 
Bottom of Page Back to top
I just had the idea to place a dummy-mesh in my type which is dynamicly positioned. Calling RecalculateMapBounds works now, but the bounds of the mesh are not changed and it's still cliped away too early.

I've made a small video to demostrate it: files.chris-a.de/temp/MeshBounds.wmv

_________________
Visit my Site: www.chris-a.de .
"there are only 10 types of people in the world: those who understand binary, and those who don't."
 
 Profile  
Administrator
Administrator
User avatar

Joined: Wed Oct 11, 2006
Posts: 5064
Location: Kazan
Country: Russia (ru)
PostPosted: Thu Apr 23, 2009 5:50 pm 
Bottom of Page Back to top
Hi here,

Do you have initialzed bounds for manually created mesh?
Mesh.SetBoundsAndRadius().

Maybe reason here.

Also MapObject has virtual MapObject.OnCalculateMapBounds() method.
You can expand bounds during calculation bounds by this method.

_________________
Founder, lead developer of NeoAxis Group Ltd.
News on Twitter, Google+, Facebook, VK
 
 Profile  
Professional License
Professional License

Joined: Mon Nov 10, 2008
Posts: 116
Location: germany->bavaria->franconia
PostPosted: Thu Apr 23, 2009 8:14 pm 
Bottom of Page Back to top
Ah, great, the combination of both finally helps to get it working! Thanks for the hint.

_________________
Visit my Site: www.chris-a.de .
"there are only 10 types of people in the world: those who understand binary, and those who don't."
 
 Profile  
Professional License
Professional License

Joined: Mon Nov 10, 2008
Posts: 116
Location: germany->bavaria->franconia
PostPosted: Sun Apr 26, 2009 11:09 am 
Bottom of Page Back to top
Hmm it's not really working, i didn't test it enough. MapBounds of the MapObject are OK, but it looks like the Mesh-Bounds are not considered. SetBoundsAndRadius changes the bounds-values but they are not used for clipping. If i enable DrawSceneNodeBounds i can see that the bounds didn't change.

_________________
Visit my Site: www.chris-a.de .
"there are only 10 types of people in the world: those who understand binary, and those who don't."
 
 Profile  
Administrator
Administrator
User avatar

Joined: Wed Oct 11, 2006
Posts: 5064
Location: Kazan
Country: Russia (ru)
PostPosted: Sun Apr 26, 2009 3:33 pm 
Bottom of Page Back to top
Ok. I will look it.

_________________
Founder, lead developer of NeoAxis Group Ltd.
News on Twitter, Google+, Facebook, VK
 
 Profile  
Administrator
Administrator
User avatar

Joined: Wed Oct 11, 2006
Posts: 5064
Location: Kazan
Country: Russia (ru)
PostPosted: Sat May 09, 2009 11:42 am 
Bottom of Page Back to top
It is strange. But here SetBoundsAndRadius() and mesh bounds are working good in all cases.

Maybe you trying to call mesh.SetBoundsAndRadius() when MeshObject are already created?
You can change this only during creating mesh.

_________________
Founder, lead developer of NeoAxis Group Ltd.
News on Twitter, Google+, Facebook, VK
 
 Profile  
Professional License
Professional License

Joined: Mon Nov 10, 2008
Posts: 116
Location: germany->bavaria->franconia
PostPosted: Sun May 10, 2009 3:18 pm 
Bottom of Page Back to top
Hi,
i don't create the mesh by myself - its a "normal" mesh with bones, and when i change the bones-positions, the mesh grows but its SceneNode does not change. Is there another way to get it working without SetBoundsAndRadius?

_________________
Visit my Site: www.chris-a.de .
"there are only 10 types of people in the world: those who understand binary, and those who don't."
 
 Profile  
Administrator
Administrator
User avatar

Joined: Wed Oct 11, 2006
Posts: 5064
Location: Kazan
Country: Russia (ru)
PostPosted: Mon May 11, 2009 7:47 pm 
Bottom of Page Back to top
Ah, understood.
Really, this is a problem.
I will think about it.

Currently you can disable scene management (frustum culling and portal system culling) for scene node and its movable objects.
This object will be visible always.

Code: Select all   Expand view
SceneNode.AllowSceneManagementCulling = false;

Better if you will call this from overrided MapObject.OnRender() every frame.

_________________
Founder, lead developer of NeoAxis Group Ltd.
News on Twitter, Google+, Facebook, VK
 
 Profile  
Professional License
Professional License

Joined: Mon Nov 10, 2008
Posts: 116
Location: germany->bavaria->franconia
PostPosted: Mon May 11, 2009 10:10 pm 
Bottom of Page Back to top
Thanks for that workarround, i will test it as soon as possible.

_________________
Visit my Site: www.chris-a.de .
"there are only 10 types of people in the world: those who understand binary, and those who don't."
 
 Profile  
Professional License
Professional License

Joined: Tue Jul 10, 2007
Posts: 396
PostPosted: Tue May 12, 2009 11:13 am 
Bottom of Page Back to top
Very nice Tip, Betauser !
thanks.

_________________
Freeman
 
 Profile  
Administrator
Administrator
User avatar

Joined: Wed Oct 11, 2006
Posts: 5064
Location: Kazan
Country: Russia (ru)
PostPosted: Thu May 14, 2009 3:03 pm 
Bottom of Page Back to top
MeshObject.SetCustomBoundsAndRadius(Bounds bounds, float radius) method for 0.81 will be added.

_________________
Founder, lead developer of NeoAxis Group Ltd.
News on Twitter, Google+, Facebook, VK
 
 Profile  
Professional License
Professional License

Joined: Mon Nov 10, 2008
Posts: 116
Location: germany->bavaria->franconia
PostPosted: Thu May 14, 2009 6:43 pm 
Bottom of Page Back to top
Great to hear that, thanks.

_________________
Visit my Site: www.chris-a.de .
"there are only 10 types of people in the world: those who understand binary, and those who don't."
 
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  NeoAxis Forum Index » General » Bugs

Jump to:  

Next topic
Previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron

All times are UTC




Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group