Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3508 Members - Latest Member: NevilleKemp

26. May 2012, 06:17:09 pm
Xith3D CommunityGeneral CategorySupport (Moderator: Marvin Fröhlich)Adding transform groups
Pages: [1]
Print
Author Topic: Adding transform groups  (Read 132 times)
pboechat
Just dropped in

Offline Offline

Posts: 15


View Profile
« on: 20. September 2011, 04:31:51 pm »

I have the following situation:

I'm copying new branch groups to the root of my scenegraph at runtime.

Code:
          public static void copyAndInvalidateSource(BranchGroup destination, BranchGroup source) {
List<Node> children;

if (source == null || destination == null) {
throw new IllegalArgumentException();
}

destination.removeAllChildren();
children = new ArrayList<Node>();
for (int i = 0; i < source.numChildren(); i++) {
children.add(source.getChild(i));
}

source.removeAllChildren();
for (Node child : children) {
destination.addChild(child);
}

destination.setIsOccluder(source.isOccluder());
// TODO: bad hack!
                PrivateAccessor.setPrivateField(destination, "boundsDirty", true);
                destination.updateBounds(true);
                destination.setPickable(source.isPickable());
                destination.setPickable(source.isRenderable());
}

When I have only ONE child to be copied, and it's a transform group, looks like the transform matrix is not being updated...

When I have more than one child to be copied everything runs fine.

Do you know why this may be happening?

Att,
Logged
pboechat
Just dropped in

Offline Offline

Posts: 15


View Profile
« Reply #1 on: 20. September 2011, 04:42:31 pm »

When I have more than one child to be copied everything runs fine.

Actually, it works fine only when i have two or more transform groups with shapes as children.
« Last Edit: 20. September 2011, 05:25:04 pm by pboechat » Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #2 on: 20. September 2011, 08:01:49 pm »

Sorry, I can't investigate this atm. I hope, someone else has time for you.
Logged
pboechat
Just dropped in

Offline Offline

Posts: 15


View Profile
« Reply #3 on: 21. September 2011, 12:38:36 pm »

I feel ashamed of myself. I was mistaken again... I was misusing the Tranform3D class and thought I found I bug...

Sorry for the inconvenience,
[]'s
« Last Edit: 21. September 2011, 12:48:52 pm by pboechat » Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic