Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (536)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  odejava missing functionality  (Read 1916 times)
0 Members and 1 Guest are viewing this topic.
Offline frdfsnlght

Senior Newbie




Trying to understand


« Posted 2004-04-04 19:22:50 »

This post isn't meant to pressure Will and Jani, but meant as a place to document obvious missing functionality in the odejava binding. On a personal note, these items are holding me up, but hey, no pressure  Smiley

1) Multi-geom support within a body. Need the ability to add mulitple geometries to a body, each with their own translation/rotation relative to the body's reference point.

2) Ability to remove a Body from a World. There is, of course, a way to add a body, but no way to remove one.

3) Ability to remove a Geom from a Space. Like bodies in a world, I need to way to remove geometries from collision space.

4) DisplayTransformable.setTransform method should probably have an additional parameter: the OdeTransformable the DisplayTransformable is associated with in the DisplayBin. This would allow a single class implementing the DisplayTransformable interface to handle multiple objects. This isn't important for me now, but more a matter of Java form.

Those are the obvious ones for me.

On a related note, I'd be happy to contribute to the odejava project (instead of just whining). Should I get CVS write access or should I just post diffs to this forum?

-Tab
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #1 - Posted 2004-04-04 23:59:33 »

definitely submit issues with diffs though the collabnet page (don't use the forums).

1) is coming - in fact it's already here all that is needed is some helper methods I think

2) and 3) I could probably code in today

4) I disagree with this - OdeTransformable is an interface which means "you can get the transform from the ode object".  DisplayTransformable is an interface which means "you can set the transform to the display object".  BoundDisplayObject is what bindes these together - NOT DisplayTransformable (which is a single object).  Bascially it means you can associate *any* compatable ODE object (which there are currently 2) with any compatable display object (which can be anything really).  Does this explain your query?

Cheers,

Will.

Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #2 - Posted 2004-04-05 00:49:17 »

issues 2) and 3) resolved.

Note that you can't remove a body from a world then add it to another like you can with Geom and Space.  Bodies can only be destroyed entirely as far as I know.

Will

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline frdfsnlght

Senior Newbie




Trying to understand


« Reply #3 - Posted 2004-04-05 04:40:53 »

Will,

I took a look at 2) and 3) myself and slapped some code into my copy of the source to get things working.

As I looked at the code, I also realized the problem with removing bodies from a world, but I decided for my purposes, I could just disable/enable the body, I think. As I understand it, a disabled body isn't "processed" by ODE, so it doesn't take up any CPU. As long as I also remove the associated geometry from the space, then ODE won't auto-enable the body during a collision, since there's no geometry to collide with. If my understanding of this is flawed, please correct me.

Related to 3): when I implemented my own version of the removeGeom method and tried to use it, I got an JNI exception at line 335 of Geom.java. I had to comment out the call to Ode.dSpaceAdd to get it to work:

1  
2  
3  
4  
5  
public void removeFromSpace () {
   Ode.dSpaceRemove(spaceId, geomId);
   spaceId = Space.SPACEID_ZERO;
   //Ode.dSpaceAdd(spaceId, geomId);
}


Evidently, ODE doesn't understand a space with an ID of zero? If that fix is correct, please incorporate it.

I'd submit it as an issue, but I'm not sure how to. I think I need to be a member in the project in order to submit an issue (according to https://odejava.dev.java.net/servlets/ProjectIssues). Should I request membership?

-Tab
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #4 - Posted 2004-04-05 13:24:44 »

hi - did you look at the changes I made?  Hopefully they are similar to what you want.

Hopefully Jani will see this thread regarding the native exception - it shouldn't happen.  Although I remember seeing that before - I thought we had fixed that one.  What OS are you running?

regarding java.net - yeach request the "Observer" role and once granted you will be able to submit issues.

Cheers,

Will.

Offline frdfsnlght

Senior Newbie




Trying to understand


« Reply #5 - Posted 2004-04-05 18:04:56 »

No, I haven't done a cvs update for a couple of days. I'll do that tonight if I get a chance, and incorporate your changes.

I'm using WinXP Pro.

I'll request Observer role. Thanks.

-Tab
Offline frdfsnlght

Senior Newbie




Trying to understand


« Reply #6 - Posted 2004-04-05 22:00:44 »

Will,

I removed my changes from the code, did an update and compile, and there are no problems. In fact, my project compiled without changes, so I guess we think alike as far as method signatures.

Concerning 4) my only intent was to mirror the kind of interface used elsewhere in the Java API. For instance the TableCellRenderer interface specifies the JTable the renderer is being called for, allowing multiple tables to use the same renderer and the renderer having the ability to customize itself for the table. Perhaps your interface isn't quite the same thing, but I'd thought I'd mention it anyway. Like I said, I don't require the additional functionality.

-Tab
Offline frdfsnlght

Senior Newbie




Trying to understand


« Reply #7 - Posted 2004-04-05 22:06:27 »

This has been brought up before, but I'd thought I'd add it to this post as well:

5) "getter" methods in Body (and possibly elsewhere) should accept vecmath objects as arguments and fill them in.

If I recall a previous post, the argument against this is that it violates the java conventions. On the other hand, it greatly reduces the number of transient objects (and related garbage collection).

I also believe it was proposed to use a different method name for the additional methods (e.g., fillVelocity(Vector3f v)). That's fine by me as long as the functionality is there and the extra objects are kept to a minimum (or never created at all).

-Tab
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #8 - Posted 2004-04-05 23:20:30 »

can you please show a specific example?

I have recently added several such methods to Body and Geom.

Will.

Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #9 - Posted 2004-04-05 23:22:15 »

that discussion is here by the way: http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=physics;action=display;num=1078922931

Will.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline frdfsnlght

Senior Newbie




Trying to understand


« Reply #10 - Posted 2004-04-06 03:31:25 »

I see some of them now with the update I did earlier. But I don't see these (in Body.java):

1  
2  
3  
4  
5  
6  
public Vector3f getAngularVel(Vector3f result);
public Vector3f getFiniteRotationAxis(Vector3f result);
public Vector3f getForce(Vector3f result);
public Vector3f getLinearVel(Vector3f result);
public Matrix3f getRotation(Matrix3f result);
public Vector3f getTorque(Vector3f result);


And in Geom.java:

1  
public Matrix3f getRotation(Matrix3f result);


Sorry to be so anal; I was raised an engineer. Thanks for the work so far.

-Tab
Offline Jani Laakso

Junior Member




Do it with Java!


« Reply #11 - Posted 2004-04-19 18:09:20 »

Quote
This post isn't meant to pressure Will and Jani, but meant as a place to document obvious missing functionality in the odejava binding. On a personal note, these items are holding me up, but hey, no pressure  Smiley


Hey, ideas are always welcome!  Grin

Quote

1) Multi-geom support within a body. Need the ability to add mulitple geometries to a body, each with their own translation/rotation relative to the body's reference point.


This should already work on Odejava, although only on Low Level, William is doing work with High Level API.

Quote

2) Ability to remove a Body from a World. There is, of course, a way to add a body, but no way to remove one.


This is because how ODE works, and may I say ODE's own API is pretty wierd from some places. There is no way to remove body from a world. Also when creating a body you have to add it into a world same time which later cannot be changed, in other worlds when you create an body on ODE, worldId is required parameter.

Quote

3) Ability to remove a Geom from a Space. Like bodies in a world, I need to way to remove geometries from collision space.


This already works, however I do not remember if it's added to Higher Level API? Now that I checked the source code I see that William has already added this method to Higher Level API also.

Quote

4) DisplayTransformable.setTransform method should probably have an additional parameter: the OdeTransformable the DisplayTransformable is associated with in the DisplayBin. This would allow a single class implementing the DisplayTransformable interface to handle multiple objects. This isn't important for me now, but more a matter of Java form.


I'll let William to handle this, perhaps now it's already fixed?

Quote

On a related note, I'd be happy to contribute to the odejava project (instead of just whining). Should I get CVS write access or should I just post diffs to this forum?


You can post patches here first, then ask for developer status if it seems that you really want to participate and do commits every now and then.
Offline Jani Laakso

Junior Member




Do it with Java!


« Reply #12 - Posted 2004-04-19 18:15:34 »

Quote
Will,
As I looked at the code, I also realized the problem with removing bodies from a world, but I decided for my purposes, I could just disable/enable the body, I think. As I understand it, a disabled body isn't "processed" by ODE, so it doesn't take up any CPU. As long as I also remove the associated geometry from the space, then ODE won't auto-enable the body during a collision, since there's no geometry to collide with. If my understanding of this is flawed, please correct me.


This is wrong, because ODE automatically enables any disabled body that comes in contact with another enabled body. Hope you got it?

Here's part of ODE's own documentation:
Enable and disable a body. Disabled bodies are effectively ``turned off'' and are not updated during a simulation step. However, if a disabled body is connected to an island containing one or more enabled bodies then it will be re-enabled at the next simulation step.

Remove it from space would do the trick you are looking for.

Quote

Related to 3): when I implemented my own version of the removeGeom method and tried to use it, I got an JNI exception at line 335 of Geom.java. I had to comment out the call to Ode.dSpaceAdd to get it to work:


I assume the HL API Geom.removeFromSpace now works?

Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #13 - Posted 2004-04-20 00:12:57 »

an update:

#1 I'm having troubles with this one - even the low level API but that's another thread/issue

#2 Won't fix - use World.delete that's all there is

#3 Already possible

#4

I misunderstood this before, I think I understand you now.  However - I still don't really see the point.  If you can present a good use case I will consider it.  DisplayTransformable is really meant to represent a single object - not a collection.

The org.odejava.display package is very simple - I would think if you had a specific case like this you'd just implement your own way of keeping them in sync.  For me, I don't see the need Smiley

Will.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Riven (19 views)
2014-07-29 18:09:19

Riven (13 views)
2014-07-29 18:08:52

Dwinin (12 views)
2014-07-29 10:59:34

E.R. Fleming (31 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (42 views)
2014-07-24 01:59:36

Riven (42 views)
2014-07-23 21:16:32

Riven (28 views)
2014-07-23 21:07:15

Riven (29 views)
2014-07-23 20:56:16

ctomni231 (60 views)
2014-07-18 06:55:21
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!