Destruction in Irrlicht
-
- Posts: 36
- Joined: Mon Jan 23, 2012 11:14 pm
- Location: Lancs, UK
Destruction in Irrlicht
Hi I'm quite new to the Irrlicht
I am using PhysX 3.2.1 with Irrlicht and
I was wondering is it possible to display destruction in Irrlicht ? <And if it is possible would that include a lot of work>(whether it's woth it or not*)
i.e like custom shader etc... ?
Thanks
I am using PhysX 3.2.1 with Irrlicht and
I was wondering is it possible to display destruction in Irrlicht ? <And if it is possible would that include a lot of work>(whether it's woth it or not*)
i.e like custom shader etc... ?
Thanks
Re: Destruction in Irrlicht
Oh boy, thats a big topic.
What kind of "destruction" do you want? If it is for smaller objects like boxes etc: Sure, thats quite easy. There are different approaches to that like a Box composed of smaller parts which are handles as one box until a force great enough is applied to the box. The smaller parts are handled as seperate objects after that therefore: The box seems to be breaking.
One of many approaches to that.
When it comes to destroyable terrain:
That includes a LOT of work. I speak with experience here, since im working on something like that.
I recommend taking a look at PolyVox here. Its a nice framework which offers both, cubic and smooth terrain. Smooth terrain is extracted by the margin cubes algorithm which produces quite dense Triangle meshes. Therefore: Be carefull with PhysX, i would use a simpler per-Voxel approach here.
Back to topic: What kind of destruction?
What kind of "destruction" do you want? If it is for smaller objects like boxes etc: Sure, thats quite easy. There are different approaches to that like a Box composed of smaller parts which are handles as one box until a force great enough is applied to the box. The smaller parts are handled as seperate objects after that therefore: The box seems to be breaking.
One of many approaches to that.
When it comes to destroyable terrain:
That includes a LOT of work. I speak with experience here, since im working on something like that.
I recommend taking a look at PolyVox here. Its a nice framework which offers both, cubic and smooth terrain. Smooth terrain is extracted by the margin cubes algorithm which produces quite dense Triangle meshes. Therefore: Be carefull with PhysX, i would use a simpler per-Voxel approach here.
Back to topic: What kind of destruction?
-
- Posts: 36
- Joined: Mon Jan 23, 2012 11:14 pm
- Location: Lancs, UK
Re: Destruction in Irrlicht
Destruction of objects like doors, walls etc
Here is the problem
I have physx lab and apex installed on my pc, I can destroy the model in physx lab but it exportes the destruction data in a file format which can be used by udk not irrlicht though is there a way to use that file like prefab with all position and bounding boxes? I forgot the extension of the file but when i get back home I'll update my post. Thanks for quick reply
EDIT:
the file extensions are .apx and .apb. From what I understand one of them is suppose to be in an xml format. So would it be possible to read the data from that so called xml (.apx) file ?
I'll try it when I'll have more time on my hands and post the results on the forum.
Here is the problem
I have physx lab and apex installed on my pc, I can destroy the model in physx lab but it exportes the destruction data in a file format which can be used by udk not irrlicht though is there a way to use that file like prefab with all position and bounding boxes? I forgot the extension of the file but when i get back home I'll update my post. Thanks for quick reply
EDIT:
the file extensions are .apx and .apb. From what I understand one of them is suppose to be in an xml format. So would it be possible to read the data from that so called xml (.apx) file ?
I'll try it when I'll have more time on my hands and post the results on the forum.
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
Re: Destruction in Irrlicht
You would have to have the source or a library that can parse this in Irrlicht. Parsing is the first problem, you need to use the integrate the "APEX Destruction" APi and make it work with Irrlicht. And that is not a simple task!
-
- Posts: 115
- Joined: Mon May 17, 2010 7:42 am
Re: Destruction in Irrlicht
isn't physix limited to a object count of 65536 items? havin separated voxels can be quite limiting
Re: Destruction in Irrlicht
I dont think that he is talking about a voxel based approach here. More an object-based.
I dont beliefe Physx has builtin Voxel support.
For the Voxel approach entirely different designs should be used than for the one-object based approaches.
I dont beliefe Physx has builtin Voxel support.
For the Voxel approach entirely different designs should be used than for the one-object based approaches.
-
- Posts: 36
- Joined: Mon Jan 23, 2012 11:14 pm
- Location: Lancs, UK
Re: Destruction in Irrlicht
So basically if the APEX API can create mesh from that file, then all I have to do is to transform it to the Irrlicht equivalent along with the textures info.
Anyways thanks for replies, very help full.
Anyways thanks for replies, very help full.
-
- Posts: 36
- Joined: Mon Jan 23, 2012 11:14 pm
- Location: Lancs, UK
Re: Destruction in Irrlicht
I thought I would bring some news on how are things going. Well the news is I overestimated how much time I had and had to abandon the project for a while. Before that I did try to make the XML reader to read the destruction data. While at it I figured out that I need to load the mesh in both PhysX and Irrlicht, that probably will cause some performance cost. After that I thought that it would be good idea to explore the mesh creation process, so off I went on irrlicht API searched and searched and read and read. And quite frankly it is complicated to get the data ready for the mesh creation. I understand that I need to implement custom meshLoader to handle APEX xml files.
Question:
Should I create class which derives from IMeshLoader for example
and then implement the ? Am I going in the right direction ?
Thanks.
Question:
Should I create class which derives from IMeshLoader for example
Code: Select all
class newMeshCreator : public IMeshLoader
{
public:
// read the mesh from file
};
Code: Select all
ISceneManager::addExternalMeshLoader( &newMeshCreatorInstance )
Thanks.
Re: Destruction in Irrlicht
You want to blow up a door?
Here are the steps I would follow:
Model the door.
Save a new copy of the model. Tesselate and break into 10~20 pieces (without changing orientation)
Save each piece in it's own file.
In Irrlicht:
Define a mesh for your object, and a piecemesh array.
When the object is destroyed, create n objects from the piecemesh. Give each object a certain velocity and rotational velocity.
Every frame, update position with the collisionmanager function and update velocity/position with desired acceleration/elapsed time.
Advantage to this approach: You can predefine behaviors for different destruction behaviors.
An example of this can be seen in counter strike, with the glass.
Here are the steps I would follow:
Model the door.
Save a new copy of the model. Tesselate and break into 10~20 pieces (without changing orientation)
Save each piece in it's own file.
In Irrlicht:
Define a mesh for your object, and a piecemesh array.
When the object is destroyed, create n objects from the piecemesh. Give each object a certain velocity and rotational velocity.
Every frame, update position with the collisionmanager function and update velocity/position with desired acceleration/elapsed time.
Advantage to this approach: You can predefine behaviors for different destruction behaviors.
An example of this can be seen in counter strike, with the glass.
-
- Posts: 36
- Joined: Mon Jan 23, 2012 11:14 pm
- Location: Lancs, UK
Re: Destruction in Irrlicht
Hi Abraxas)!
Yes I want to destroy door, column or a wall. All these shapes are already defined in the APEX xml file. Reason why I want the Irrlicht to work with these files is because, PhysX is compatible with these files and the simulation should be realistic i.e. pieces are equally represented in both engines. I was thinking about this approach, but then I would have to think of a way to translate the shapes of pieces in to PhysX equivalent to achieve satysfying results.
Second reason why I want to get this to work in this way is because I would like to contribute to the Irrlicht functionality, in my personal opinion it would bring a lot of fun into games created regardless to the genre.
Anyway thanks for the input though, very appreciated.
Yes I want to destroy door, column or a wall. All these shapes are already defined in the APEX xml file. Reason why I want the Irrlicht to work with these files is because, PhysX is compatible with these files and the simulation should be realistic i.e. pieces are equally represented in both engines. I was thinking about this approach, but then I would have to think of a way to translate the shapes of pieces in to PhysX equivalent to achieve satysfying results.
Second reason why I want to get this to work in this way is because I would like to contribute to the Irrlicht functionality, in my personal opinion it would bring a lot of fun into games created regardless to the genre.
Anyway thanks for the input though, very appreciated.
Re: Destruction in Irrlicht
I've never used PhysX. Maybe it's more optimized for collision detection but there were huge improvements in 1.8.0. getCollisionPosition is MUCH faster than before.
There isn't a way to load 3ds or equivalent files in physX?
There isn't a way to load 3ds or equivalent files in physX?
-
- Posts: 36
- Joined: Mon Jan 23, 2012 11:14 pm
- Location: Lancs, UK
Re: Destruction in Irrlicht
Do you mean to try the opposite way?
Try to get PhysX to load the files I'm going to use in Irrlicht?
I think it would be more complicated than it is in Irrlicht cause I don't know how PhysX loads custom meshes and don't know whether it has support for such things? I don't know how Irrlicht does it either, ha ha.
Anyways I will look into it.
Thanks.
Try to get PhysX to load the files I'm going to use in Irrlicht?
I think it would be more complicated than it is in Irrlicht cause I don't know how PhysX loads custom meshes and don't know whether it has support for such things? I don't know how Irrlicht does it either, ha ha.
Anyways I will look into it.
Thanks.
Re: Destruction in Irrlicht
The point I was trying to make was, why use physx for this? What are you specifically trying to do? Like. What exactly do you want to happen?
-
- Posts: 36
- Joined: Mon Jan 23, 2012 11:14 pm
- Location: Lancs, UK
Re: Destruction in Irrlicht
Basically I'm working on a college project. In this project me and the rest of the team have to create a game which would be our final year project. Up to this point we have set up the PhysX and Irrlicht engine working parrallel and communicating. Next step I wanted to take it to was to implement destruction of some of the objects in the scene. If it's going to be too hard then I will have to cheat with the destruction, nevertheless I want to avoid this and as I mentioned before would like to add a bit of functionality to the Irrlicht engine.
Re: Destruction in Irrlicht
I was referring to your destruction algorithm. I think the functionality you are looking for does already exist in irrlicht.