Editor style Grid SceneNode [Updated: Sept. 27, 2009]
-
- Posts: 368
- Joined: Tue Aug 21, 2007 1:43 am
- Location: The Middle of Nowhere
-
- Posts: 368
- Joined: Tue Aug 21, 2007 1:43 am
- Location: The Middle of Nowhere
Now that I updated my code with your new version I see there's another warning regarding u32-f32 issues.
1. Why does the clone method returns a ISceneNode* and not CGridSceneNode* ?
2. What "AutomaticCullingState = EAC_BOX;" does?
EDIT:
3. You say "//Axis Lines are a default Red and Blue for the X and Z axis respectively." but they aren't.
Code: Select all
if(m_AxisLineState == true)
{
driver->draw3DLine(vector3df(m_size,0,0),vector3df(-m_size,0,0),m_XLineColor);
driver->draw3DLine(vector3df(0,0,m_size),vector3df(0,0,-m_size),m_ZLineColor);
}
Should be something like this:1>------ Build started: Project: <My project's name>, Configuration: Debug Win32 ------
1>Compiling...
1>CGridSceneNode.cpp
3 times both of this warnings:
conversion from 'irr::u32' to 'irr::f32', possible loss of data
unary minus operator applied to unsigned type, result still unsigned
1><My project's name> - 0 error(s), 6 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
Code: Select all
if(m_AxisLineState == true)
{
driver->draw3DLine(vector3df((f32)m_size,0,0),vector3df(-(f32)m_size,0,0),m_XLineColor);
driver->draw3DLine(vector3df(0,0,(f32)m_size),vector3df(0,0,-(f32)m_size),m_ZLineColor);
}
2. What "AutomaticCullingState = EAC_BOX;" does?
EDIT:
3. You say "//Axis Lines are a default Red and Blue for the X and Z axis respectively." but they aren't.
-
- Posts: 368
- Joined: Tue Aug 21, 2007 1:43 am
- Location: The Middle of Nowhere
Seems like I forgot a place where m_size was still being used; I'll fix that soon. I'll also see about changing the return type of the clone() method for ya
AutomaticCullingState = EAC_BOX; tells irrlicht to default to using the Box method for culling this node. Not the most efficient for actually getting rid of the node if it can't be seen, but it is a cheap calculation. This flag is normally changed via the setAutomaticCulling() function. Frustrum would be better, but I'm not sure how much more it would cost per frame. I could set it to none, but that would mean that the grid would never stop rendering itself.
The colors aren't red and blue? Hmm... I might have messed that up while testing. I'll be sure to fix that as well.
AutomaticCullingState = EAC_BOX; tells irrlicht to default to using the Box method for culling this node. Not the most efficient for actually getting rid of the node if it can't be seen, but it is a cheap calculation. This flag is normally changed via the setAutomaticCulling() function. Frustrum would be better, but I'm not sure how much more it would cost per frame. I could set it to none, but that would mean that the grid would never stop rendering itself.
The colors aren't red and blue? Hmm... I might have messed that up while testing. I'll be sure to fix that as well.
rogerborg wrote:Every time someone learns to use a debugger, an angel gets their wings.
I've fixed that x-red z-blue thing, warnings, clone thing and made it more doxygen friendly, check it out, maybe continue work on this version?
http://rapidshare.com/files/82286299/CGridSceneNode.zip
http://rapidshare.com/files/82286299/CGridSceneNode.zip
-
- Posts: 368
- Joined: Tue Aug 21, 2007 1:43 am
- Location: The Middle of Nowhere
Thanks a lot man. I changed the code a little bit to add back the default values to the constructor, as well as setting the default culling mode to frustum box. I want people to be able to set this node up quickly and easily, without having to type 50 some characters into the constructor
Again thanks. I've uploaded the newest copy.
If anyone would like to see something else added to this node, please ask. I'm really surprised how much it's grown.
[edit] Typo attack!
Again thanks. I've uploaded the newest copy.
If anyone would like to see something else added to this node, please ask. I'm really surprised how much it's grown.
[edit] Typo attack!
rogerborg wrote:Every time someone learns to use a debugger, an angel gets their wings.
I looked it up and I don't see any changes from what I sent except the frustum thing.. Care to mention Where you changed?Dark_Kilauea wrote:I changed the code a little bit...
Well, I use it in my project so I might think of more things later on..Dark_Kilauea wrote:If anyone would like to see something else added to this node, please ask. I'm really surprised how much it's grown
1. Its a great scene node, thank You for making it out of Mohaps's code.
2. Thanks for adding my nick in the .h file.
3. Update again the subject
4. If you want I can generate a .chm file using the doxygen comments (yes, for evey release of it) and send it to you so it can be added to the zip file.
-
- Posts: 368
- Joined: Tue Aug 21, 2007 1:43 am
- Location: The Middle of Nowhere
1. Look in the constructor parameters. You'll see I added the defaults back.
2. You're welcome, I pay my minions well
3. Subject should be fine, the last update was Jan. 08
4. I don't think a chm help file will be necessary. Anyone should be able to figure out the node from the comments, and besides, it works just fine without most of the parameters.
2. You're welcome, I pay my minions well
3. Subject should be fine, the last update was Jan. 08
4. I don't think a chm help file will be necessary. Anyone should be able to figure out the node from the comments, and besides, it works just fine without most of the parameters.
rogerborg wrote:Every time someone learns to use a debugger, an angel gets their wings.
-
- Posts: 368
- Joined: Tue Aug 21, 2007 1:43 am
- Location: The Middle of Nowhere
PM read
Thanks for hosting a copy of this scenenode for me. To others: Check out the primary mirror. Please try to use the primary first to save me bandwidth on my webhost. I've provided the second one in case rapidshare doesn't work for you.
Thanks.
Thanks for hosting a copy of this scenenode for me. To others: Check out the primary mirror. Please try to use the primary first to save me bandwidth on my webhost. I've provided the second one in case rapidshare doesn't work for you.
Thanks.
rogerborg wrote:Every time someone learns to use a debugger, an angel gets their wings.
A little fix to the clone method:
Oh and it should be clone not Clone but I was the one who changed it to be Clone so it's my bad..
Code: Select all
//! Creates a clone of this scene node and its children.
virtual CGridSceneNode* clone(ISceneNode* newParent = 0, ISceneManager* newSceneManager = 0);
Code: Select all
CGridSceneNode* CGridSceneNode::clone(ISceneNode *newParent, ISceneManager *newSceneManager)
{
if (!newParent) newParent = Parent;
if (!newSceneManager) newSceneManager = SceneManager;
CGridSceneNode* cloner = new CGridSceneNode(
newParent, // this line
newSceneManager, // and this line
ID,
m_spacing,
m_size*2,
m_gridcolor,
m_accentlineoffset,
m_accentgridcolor,
m_AxisLineState);
cloner->SetAxisLineXColor(m_XLineColor);
cloner->SetAxisLineZColor(m_ZLineColor);
cloner->SetMaterial(Material);
cloner->drop();
return cloner;
}
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact: