Search found 9717 matches

by CuteAlien
Mon Sep 09, 2024 8:15 am
Forum: Advanced Help
Topic: How do I make a gun turret that is child of a node point at another node in the root scene?
Replies: 5
Views: 182

Re: How do I make a gun turret that is child of a node point at another node in the root scene?

setPosition and manually setting to 0 both should work enough for this (as [15] should be 0 already). Your code kinda looks like what I'd expect to work. Except for having yaw and pitch separated. I'm not sure what that is doing and maybe it's messing up things. With euler rotations the order matter...
by CuteAlien
Sun Sep 08, 2024 11:13 pm
Forum: Advanced Help
Topic: How do I make a gun turret that is child of a node point at another node in the root scene?
Replies: 5
Views: 182

Re: How do I make a gun turret that is child of a node point at another node in the root scene?

If you use svn trunk version of Irrlicht things are slightly easier. It has a function ISceneNode::setUpdateAbsolutePosBehavior which you can set to irr::scene::ESNUA_TRANSFORM_POSITION. Then child-nodes simply ignores the parent rotation and only updates the position based on parent. So child has i...
by CuteAlien
Mon Sep 02, 2024 10:34 am
Forum: Beginners Help
Topic: How to parse integer from wide char string?
Replies: 4
Views: 188

Re: How to parse integer from wide char string?

Sorry, not enough information. Check the pointers. Make sure the ID's are correct. Is that element really a IGUIEditBox? You can also see all that in the debugger, just set a breakpoint and step through (if you ware not familiar with a debugger yet, take the chance to learn it, it's simply to use an...
by CuteAlien
Sun Sep 01, 2024 8:50 pm
Forum: Beginners Help
Topic: How to parse integer from wide char string?
Replies: 4
Views: 188

Re: How to parse integer from wide char string?

STL has some function in <string> like stoi or others in <cwchar> like wcstoll. Irrlicht has no tool function for wchar_t I think - so you'd have to convert to char first.
by CuteAlien
Fri Aug 30, 2024 1:01 pm
Forum: Beginners Help
Topic: How to hide all gui elements?
Replies: 2
Views: 103

Re: How to hide all gui elements?

You can loop over children like: irr::core::list<IGUIElement*>& children = guiElement->getChildren(); for (irr::core::list<IGUIElement*>::Iterator it = children.begin(); it != Children.end(); ++it) { (*it)->setVisible(false); } Note that when you hide a parent element then all children are hidde...
by CuteAlien
Tue Aug 27, 2024 9:38 am
Forum: Game Programming
Topic: How do I get "relative" angular velocity so that I can control pitch, roll and yaw angular velocity on a space ship?
Replies: 11
Views: 791

Re: How do I get "relative" angular velocity so that I can control pitch, roll and yaw angular velocity on a space ship?

I don't say it can't be done. I say you can't get it just from comparing 2 matrices. But you need the info about the path taken. It's the same in 2d - if you walk around in your city and I record 2 points in time where you have been I still won't be able to tell how fast you walked. Not unless I als...
by CuteAlien
Sun Aug 18, 2024 3:15 pm
Forum: Beginners Help
Topic: Getting the patch associated with LOD in getCurrentLODOfPatches()
Replies: 4
Views: 293

Re: Getting the patch associated with LOD in getCurrentLODOfPatches()

Not sure if other nodes are patched that easily for that, terrain is somewhat special. For the general case it's probably easier to have application code which switches out the mesh (or node) at a certain distance. Also I noticed that with newer GPU's you can go really high with polygons before thos...
by CuteAlien
Sun Aug 18, 2024 10:53 am
Forum: Beginners Help
Topic: Getting the patch associated with LOD in getCurrentLODOfPatches()
Replies: 4
Views: 293

Re: Getting the patch associated with LOD in getCurrentLODOfPatches()

Not code I'm really familiar with. But on a quick check - getCurrentLODOfPatches returns indices to an array which is always square. So in theory setLODOfPatch could be used to set another LOD and the maximal patchX and patchZ you can set should be the sqrt(of the array size returned by getCurrentLO...
by CuteAlien
Tue Aug 13, 2024 7:25 pm
Forum: Beginners Help
Topic: How to add normalmaps into animated mesh?
Replies: 2
Views: 241

Re: How to add normalmaps into animated mesh?

If you are lucky the format already creates a meshbuffer with tangents (I think .X format does, not sure about others). Then you have to ensure the normalmap is in texture 1 slot (slot 0 has diffuse). And materialType is EMT_NORMAL_MAP_SOLID, EMT_PARALLAX_MAP_SOLID, EMT_NORMAL_MAP_TRANSPARENT_VERTEX...
by CuteAlien
Fri Aug 09, 2024 9:55 am
Forum: Off-topic
Topic: performance of bitwise operators vs conventional methods
Replies: 4
Views: 431

Re: performance of bitwise operators vs conventional methods

Ah yes, -O3 is with g++ compiler. Visual studio tends to automatically create 2 compile targets called "debug" and "release" for new c++ projects. And release has all the typical optimizations. In general people work with debug for development (because debugging is easier) and re...
by CuteAlien
Thu Aug 08, 2024 11:59 pm
Forum: Off-topic
Topic: performance of bitwise operators vs conventional methods
Replies: 4
Views: 431

Re: performance of bitwise operators vs conventional methods

Slight risk the compiler will optimize away your "complex operation" as the result isn't used. Better to have one result variable on top and maybe print out at the end or something so it can't be removed. If it's not removed I'd rather suspect it's not compiled with optimizations. Also not...
by CuteAlien
Thu Aug 08, 2024 12:19 am
Forum: Beginners Help
Topic: Should be obvious
Replies: 2
Views: 339

Re: Should be obvious

I wrote down some options for doing this in a recent post: viewtopic.php?t=53033
Hope that helps.
by CuteAlien
Tue Aug 06, 2024 9:25 am
Forum: Code Snippets
Topic: Typewriter Text Effect
Replies: 2
Views: 458

Re: Typewriter Text Effect

Works nicely. You could also use the irrlicht strings for this I guess (to avoid mixing Stl with Irrlicht). Thought I have to admit I also often mix those ;-)
by CuteAlien
Sun Aug 04, 2024 11:26 pm
Forum: Game Programming
Topic: How do I get "relative" angular velocity so that I can control pitch, roll and yaw angular velocity on a space ship?
Replies: 11
Views: 791

Re: How do I get "relative" angular velocity so that I can control pitch, roll and yaw angular velocity on a space ship?

relVel without parameters is initialized to 0. Transformation use multiplications so 0 stays 0. I do not know what you mean with relative velocity. Do we still talk about angular velocity? Or do you mean real velocity (ship speed) now? Try initializing relVel with your velocity then instead of 0. Al...
by CuteAlien
Fri Aug 02, 2024 11:10 am
Forum: Game Programming
Topic: How do I get "relative" angular velocity so that I can control pitch, roll and yaw angular velocity on a space ship?
Replies: 11
Views: 791

Re: How do I get "relative" angular velocity so that I can control pitch, roll and yaw angular velocity on a space ship?

If getAngularVelocity is in radians you can use setRotationRadians in the Irrlicht matrix. Your guess wasn't correct in this case. You can kinda think of as those 3 rows in the inner 3x3 matrix as the directions of the x,y,z axes (so for example could be the front, up, right directions your ship has...