Didn't the code you have already return the tile? As in selectedSceneNode should be one of your tiles?
Changing texture is done via the material. You seem to know quite a bit programming, so I guess you'll figure it out. I have to sleep.
Search found 9649 matches
- Wed Feb 21, 2024 11:15 pm
- Forum: Advanced Help
- Topic: Ray casting and tiles
- Replies: 31
- Views: 4536
- Wed Feb 21, 2024 10:46 pm
- Forum: Advanced Help
- Topic: Ray casting and tiles
- Replies: 31
- Views: 4536
Re: Ray casting and tiles
What is colliding and what's the collision supposed to do?
- Wed Feb 21, 2024 10:34 pm
- Forum: Advanced Help
- Topic: Ray casting and tiles
- Replies: 31
- Views: 4536
Re: Ray casting and tiles
OK, cool :)
- Wed Feb 21, 2024 10:22 pm
- Forum: Advanced Help
- Topic: Ray casting and tiles
- Replies: 31
- Views: 4536
Re: Ray casting and tiles
Before doing any collisions. createTriangleSelector creates the collision geometery (triangles for your mesh polygons) which is needed for checking collisions later.
- Wed Feb 21, 2024 10:02 pm
- Forum: Advanced Help
- Topic: Ray casting and tiles
- Replies: 31
- Views: 4536
Re: Ray casting and tiles
It's just those 2 lines I mentioned. But I messed up post originally - createTriangleSelector is in ISceneManager, not ISceneNode. And you need some function in your node to return the mesh so you can pass it to createTriangleSelector. So for each HexTile node, something like ITriangleSelector * sel...
- Wed Feb 21, 2024 9:41 pm
- Forum: Advanced Help
- Topic: Ray casting and tiles
- Replies: 31
- Views: 4536
Re: Ray casting and tiles
ISceneManager::createTriangleSelector with the mesh and node (you have to pass both as often same mesh is used by several nodes, although not in your case). Then ISceneNode::setTriangleSelector. And hopefully then your original collMan->getSceneNodeAndCollisionPointFromRay code will work. Side-note ...
- Wed Feb 21, 2024 9:08 pm
- Forum: Advanced Help
- Topic: Ray casting and tiles
- Replies: 31
- Views: 4536
Re: Ray casting and tiles
Maybe you have to update your draw code. You can directly use driver->drawMeshbuffer now. Otherwise set breakpoint (or printf) in draw code and check if it reaches it.
edit: Also you can use recalculateBoundingBox () for your mesh. And then set your node Box to the result.
edit: Also you can use recalculateBoundingBox () for your mesh. And then set your node Box to the result.
- Wed Feb 21, 2024 8:56 pm
- Forum: Advanced Help
- Topic: Ray casting and tiles
- Replies: 31
- Views: 4536
Re: Ray casting and tiles
Looks good. Now you can create a triangle selector for it and set it for the node. Then your first code for collision should work.
- Wed Feb 21, 2024 8:36 pm
- Forum: Advanced Help
- Topic: Ray casting and tiles
- Replies: 31
- Views: 4536
Re: Ray casting and tiles
Check source/Irrlicht/CGeometryCreator.cpp - it has several functions which work with SMeshBuffer. Or example 23 SMeshHandling.
- Wed Feb 21, 2024 8:31 pm
- Forum: Beginners Help
- Topic: Tile based map
- Replies: 6
- Views: 1376
Re: Tile based map
Yeah, that one is a bit interesting due to the transitions between the tiles. Which tile will be selected when you click one of the transition polygons? There is also different ways to approach this. Using one tile per node seems tricky for this. For the 6 sides you could say half the side for conne...
- Wed Feb 21, 2024 8:09 pm
- Forum: Advanced Help
- Topic: Ray casting and tiles
- Replies: 31
- Views: 4536
Re: Ray casting and tiles
Mesh with: new irr::scene::SMesh() Then add a meshbuffer - in your case an SMeshBuffer will probably do. So: new irr::scene::SMeshBuffer() Then add the meshbuffer to the mesh. That meshbuffer can contain your vertices like you did above. That's basically it. It adds a few dynamic allocations, so not...
- Wed Feb 21, 2024 7:51 pm
- Forum: Beginners Help
- Topic: Tile based map
- Replies: 6
- Views: 1376
Re: Tile based map
I'm a bit confused as you already seem to have one in the other thread. Which looks pretty nice with just the collisions missing. And I already gave you 2 solutions how to write those. Maybe just try first if you can implement one of those. And when stuck with it ask more questions? edit: With the p...
- Wed Feb 21, 2024 7:19 pm
- Forum: Beginners Help
- Topic: Tile based map
- Replies: 6
- Views: 1376
Re: Tile based map
You seem to be doing it already in your other thread? It didn't looks so bad. There you seem to have created one node per tile. Which is one way to do it. The other way would be to create a node which contains all tiles and has functions to access them. But unless the world is really huge it doesn't...
- Wed Feb 21, 2024 4:35 pm
- Forum: Advanced Help
- Topic: Ray casting and tiles
- Replies: 31
- Views: 4536
Re: Ray casting and tiles
Your node needs to have a triangle selector for the collision manager to work. It's basically geometry data so the line can collide against something. With a custom node you have 2 options: First: Instead of using just Vertices you create a real mesh inside your node. Then the ISceneManager::createT...
- Mon Feb 19, 2024 5:00 pm
- Forum: Open Discussion and Dev Announcements
- Topic: Quit key / Receiver in demos
- Replies: 2
- Views: 1349
Re: Quit key / Receiver in demos
You can't push changes anyway without write rights ;-) You can propose patches. But yes, as Brainsaw said - use Alt+F4. But I remember someone else had this trouble before, I guess that key combination is maybe not known as much anymore as it had been in the past. Maybe we should add a hint, like in...