Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (578)
games submitted by our members
Games in WIP (499)
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 1846 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.

 

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

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (31 views)
2014-04-15 18:08:23

BurntPizza (28 views)
2014-04-15 03:46:01

UprightPath (43 views)
2014-04-14 17:39:50

UprightPath (26 views)
2014-04-14 17:35:47

Porlus (42 views)
2014-04-14 15:48:38

tom_mai78101 (64 views)
2014-04-10 04:04:31

BurntPizza (124 views)
2014-04-08 23:06:04

tom_mai78101 (223 views)
2014-04-05 13:34:39

trollwarrior1 (190 views)
2014-04-04 12:06:45

CJLetsGame (198 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!