Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (416)
games submitted by our members
Games in WIP (307)
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  
  TransformNode  (Read 1512 times)
0 Members and 1 Guest are viewing this topic.
Offline croft

Junior Member




Java, Java, Java


« Posted 2006-09-24 11:53:48 »

It has been awhile since I did a CVS update on Xith.  My code no longer compiles.  I see there have been a lot of changes.

I have updated my code here and there to adjust to the new API but I need a few fixes.  I will give them to you one at a time.  Hopefully we can get my application to compile again within a few days.

First, please add a getName() method to the new interface TransformNode.

David Wallace Croft / www.CroftSoft.com / (214) 636-3790 m / Advanced Java Game Programming
Offline Marvin Fröhlich

Senior Member




May the 4th, be with you...


« Reply #1 - Posted 2006-09-24 11:59:25 »

First, please add a getName() method to the new interface TransformNode.

Done.
Offline croft

Junior Member




Java, Java, Java


« Reply #2 - Posted 2006-09-24 12:17:20 »

Please add getChildren().

David Wallace Croft / www.CroftSoft.com / (214) 636-3790 m / Advanced Java Game Programming
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Marvin Fröhlich

Senior Member




May the 4th, be with you...


« Reply #3 - Posted 2006-09-24 12:19:59 »

Please add getChildren().

A TransformNode is not a Group so this methods does not make any sense. If you know exactly that you're having a TransformGroup, then use this type or cast to it. But this methods cannot be present in the TransformNode interface. Sorry.
Offline croft

Junior Member




Java, Java, Java


« Reply #4 - Posted 2006-09-24 13:18:20 »

A TransformNode is not a Group so this methods does not make any sense. If you know exactly that you're having a TransformGroup, then use this type or cast to it. But this methods cannot be present in the TransformNode interface. Sorry.

OK, I did the cast.

My next question is this:
scene.setSceneGroup ( sceneBranchGroup )

This no longer works because BranchGroup is not a subclass of Group anymore.  What should I do?

David Wallace Croft / www.CroftSoft.com / (214) 636-3790 m / Advanced Java Game Programming
Offline Marvin Fröhlich

Senior Member




May the 4th, be with you...


« Reply #5 - Posted 2006-09-24 13:24:58 »

A TransformNode is not a Group so this methods does not make any sense. If you know exactly that you're having a TransformGroup, then use this type or cast to it. But this methods cannot be present in the TransformNode interface. Sorry.

OK, I did the cast.

My next question is this:
scene.setSceneGroup ( sceneBranchGroup )

This no longer works because BranchGroup is not a subclass of Group anymore.  What should I do?

Just use an instance of Group, but not BranchGroup. The BranchGroup is reserved to be the very root of a branch in the scenegraph. In general a loader loads 3D models, which're not to be placed into to scenegraph as root branch (BranchGroup). But some loaders (or a single load) actually load a whole level, so maybe an additional method in any loader would make sense, which loads a scene as BranchGroup or so. What do you think?
Offline croft

Junior Member




Java, Java, Java


« Reply #6 - Posted 2006-09-24 14:42:59 »

Just use an instance of Group, but not BranchGroup. The BranchGroup is reserved to be the very root of a branch in the scenegraph. In general a loader loads 3D models, which're not to be placed into to scenegraph as root branch (BranchGroup). But some loaders (or a single load) actually load a whole level, so maybe an additional method in any loader would make sense, which loads a scene as BranchGroup or so. What do you think?

This code does not compile:
1  
2  
3  
4  
5  
6  
       final Group  sceneBranchGroup = scene.getSceneGroup ( );
       
       if ( sceneBranchGroup != null )
       {      
         locale.addBranchGraph ( ( BranchGroup ) sceneBranchGroup );
       }


scene.getSceneGroup()  returns a Group.
locale.addBranchGraph() takes a BranchGroup as its argument.
BranchGroup is not a subclass of Group so I cannot do the cast.

David Wallace Croft / www.CroftSoft.com / (214) 636-3790 m / Advanced Java Game Programming
Offline Marvin Fröhlich

Senior Member




May the 4th, be with you...


« Reply #7 - Posted 2006-09-24 14:48:02 »

scene.getSceneGroup()  returns a Group.
locale.addBranchGraph() takes a BranchGroup as its argument.
BranchGroup is not a subclass of Group so I cannot do the cast.

This is what I meant by the suggestion in the last post regarding the additional method loading the scene as BranchGroup. But a pragmatic solution would be to change the return type of scene.getSceneGroup() from Group to GroupBase, which is the base class of Group and BranchGroup. Feel free to make the change.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars and Titan!

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

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
mrbenebob (17 views)
2013-06-19 14:55:23

BrassApparatus (27 views)
2013-06-19 08:52:37

NegativeZero (30 views)
2013-06-19 03:31:52

NegativeZero (33 views)
2013-06-19 03:24:09

Jesse_Attard (36 views)
2013-06-18 22:03:02

HeroesGraveDev (73 views)
2013-06-15 23:35:23

Vermeer (74 views)
2013-06-14 20:08:06

davedes (75 views)
2013-06-14 16:03:55

alaslipknot (66 views)
2013-06-13 07:56:31

Roquen (90 views)
2013-06-12 04:12:32
Smoothing Algorithm Question
by UprightPath
2013-05-28 02:58:26

Smoothing Algorithm Question
by UprightPath
2013-05-28 02:57:33

Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38
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!