So update time. I worked a lot yesterday and not shit today. No video since all changes are code stuffs and are hard to visualize properly.
Basically, the new collision model and hitbox systems are in place and ready to go. This is thanks partially to some really nice classes I wrote (ConvexHull and PhysModel) that allow the importing and usage of .obj files as both PhysicsTriMesh and PhysicsConvexCollisionHull. I also want to go ahead and say that I WANT THE GUY THAT CREATED THE COLLISION MASK SYSTEM TO HAVE MY BABIES. Collision masks saved me so much god damn time and frustration. It's gr8.
Any ways, every actor in the game world now has a hitbox and collision. The hitbox is used for testing bullet and projectiles and other shit like that for hits. The hitbox should match the visual model pretty closely but still be as low poly as you can make it. The collision is the actually physics model that is used to do... physics... Pretty simple.
Now for the interesting part! How you make a collision model and hitbox model in 12D!
I thought about it for a while and decided to make it a part of the tag system. Here is an example of a simple collision model in a tag.
Code:
object collision {
object 0 {
property parent root;
property type simple;
property shape hull;
property mass 1;
property file "item/weapon/sniperrifle/sniperrifle.collision";
object location {
property x 0;
property y 0;
property z 0;
}
object rotation {
property x 0;
property y 0;
property z 0;
property w 0;
}
}
}
object hitbox {
object 0 {
property parent root;
property type simple;
property shape hull;
property mass 1;
property file "item/weapon/sniperrifle/sniperrifle.collision";
object location {
property x 0;
property y 0;
property z 0;
}
object rotation {
property x 0;
property y 0;
property z 0;
property w 0;
}
}
}
Alright so it should be pretty easy to see how it works overall. You can make the collision and hitbox models different and you probably should most of the time. I have not for this test.
Now I bet you are wondering why it says "type simple". This is because you can have COMPOUND COLLISION MODELS MOTHER FUCKERS
Code:
object collision {
object 0 {
property parent root;
property type compound;
property mass 4;
object 0 {
property shape box;
property width 1;
property length 1;
property height 1;
object location {
property x 0;
property y 0;
property z 0;
}
object rotation {
property x 0;
property y 0;
property z 0;
property w 0;
}
}
object 1 {
property shape sphere;
property radius 1;
object location {
property x 5;
property y 0;
property z 0;
}
object rotation {
property x 0;
property y 0.2;
property z 0;
property w 1;
}
}
object 2 {
property shape cylinder;
property radius 1;
property height 1;
object location {
property x 0;
property y 2;
property z 0;
}
object rotation {
property x 0;
property y 0;
property z 0;
property w 0;
}
}
object 3 {
property shape cone;
property radius 1;
property height 1;
object location {
property x 0;
property y 0;
property z 3;
}
object rotation {
property x 0;
property y 0;
property z 0;
property w 0;
}
}
object 4 {
property shape capsule;
property radius 1;
property height 1;
object location {
property x 0;
property y 5;
property z -1;
}
object rotation {
property x 0.1;
property y 0;
property z 0.1;
property w 1;
}
}
object 5 {
property shape hull;
property file "multipurpose/model/box.collision";
object location {
property x 0;
property y 0;
property z 0;
}
object rotation {
property x 0;
property y 0;
property z 0;
property w 0;
}
}
}
}
Okay for those who don't understand this, a compound collision model is basically a collision model made up of multiple convex shapes. This allows you to make like... a giant space ship that you can walk around in while it flys. I will make a visual editor for these collision/hitbox models later on but for now it's all text. The code is there to make it all work I just need a user friendly way to make them haah.
Also another note, there will be a way to have multiple hitboxes in the tag and then connect them to parts of the model. This is so when a player is animated the leg hitboxes are attached to the legs and stuff.
Also there will be options with the collision model to allow you to create rag dolls and stuff. That is not a priority at the moment but it's on the list.
I also today extended the btRB objects and added a field for "owners" so when I shoot a bitch with my gun I can get the reference to the bitch that was shot.
Basically means guns work now.
Anyways, good night everone. I have work in the morning and I'm going to want to kill myself for staying up this late.
Bookmarks