Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - AppletMan

Pages: [1]
1
Support / Object Siblings
« on: December 23, 2010, 01:20:20 am »
Suggesting the ability to create object siblings or groups of objects in JPCT.

My problem was this...  I'm using software rendering and I've made a point-and-click world editor and have 3DS walls for my world with partially transparent glass and opaque frames.  I cannot use a world object model transparency because the transparency, when set, translates to the entire object.  I cannot use a transparent (black) section of a texture because it's fairly all or nothing with the transparent area.  If I use two objects and join them with child/parent relationships and click on one section to translate the entire group only selecting the parent object effects the group.  My solution was to load two separate objects and join them with my own sibling relationship.

I'm familiar with addChild() and addParent() methods, however they only work in one direction.  It would be nice to group objects together with a  method such as “addSibling()”.  I could then select any one of those objects and the translations I apply would effect all of them equally.   I've worked with many grouped model translations which, even when the object exist in separate locations, it's nice to be able to move them together as a unit once arranged.

The only translation which would be a problem would be rotations.  In most sibling relationships, the objects rotate as a unit from a common center rather then all of them turning at the same time in their own matrix.  So far, in JPCT, I've only worked with objects sharing a common center.

I've created my own method to accomplish the same goal with setUserObject() as a sibling object which follows the same translations.  Before applying the translation I check to see if it “hasSibling()” and then apply the translations to all of the siblings if they exist via looping through an array.

Thanks for the awesomeness of JPCT!  I've been working with it, on and off, for about two years and it's fantastic.

Pages: [1]