Sign in to follow this  
Tasos

Balls colliding with walls

Recommended Posts

[font="Arial"]Hello,

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:

[/font][list=1][*][font="Arial"]divide the track model into parts[/font][*][font="Arial"]name them[/font][*][font="Arial"]load the track model as an ObjectContainer3d[/font][*][font="Arial"]use the "getChildByName" method to retrieve each part and assign "physics" properties to it.[/font][/list] [font="Arial"]
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:


[/font][list=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][*][font="Arial"]What other ways of "[b]making a ball collide with walls[/b]" exist?[/font][/list]

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this