Jump to content
  • Advertisement
Sign in to follow this  

Balls colliding with walls

This topic is 2532 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts


I am trying to create the tracks of a mini-golf game. The track models load fine
(Blender for creation and Prefab3d for exporting as "as3" for Away3d).

However, I want to add "physics" to the track so for the golf ball to roll inside it
while hitting at the track's walls. For that I use the JigLibFlash physics engine.

At first, I tried turning the loaded "track model" into a JTriangleMesh but, with no luck.
So, I have decided to:

  1. [font="Arial"]divide the track model into parts[/font]
  2. [font="Arial"]name them[/font]
  3. [font="Arial"]load the track model as an ObjectContainer3d[/font]
  4. [font="Arial"]use the "getChildByName" method to retrieve each part and assign "physics" properties to it.[/font]
The problem is that I have found only one example using the "getChildByName" method for loading
external models. That example uses the Collada format and its "name" attribute. But, in the latest
version of Blender, the "name" attribute does not exist. The names assigned to meshes in Blender
are turned into "ids" in the Collada file.

By editing the Collada file myself, a problem occurs while parsing the file using the Collada parser of
the Away3d engine.

That is why I would like to ask the following two things:

  1. [font="Arial"]Is there another way of loading external models and get each part of the model so as to assign "physics" properties to each part individually?[/font]
  2. [font="Arial"]What other ways of "making a ball collide with walls" exist?[/font]

Share this post

Link to post
Share on other sites
You know, it is physically impossible for me to respond to your post, because I am unwilling/incapable of reading that awful font.

Just an fyi, but you are much more likely to get a response in a more standard font.

Share this post

Link to post
Share on other sites
Do you have access to the .getChildByName() code? It would seem trivial enough to use id instead if you do?

Share this post

Link to post
Share on other sites
I have access to the "getChildByName" method. And I have made an attempt to create a "getChildById" method.

The method is in the "ObjectContainer3D" of Away3d and returns an "Object3D". Now, the latter has an "id"
property that is of type "int".

Because of the fact that the Collada format assigns ids that are strings I believe that the id of the ".dae" file
and the id of the "Object3d" object do not refer to the same thing.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!