Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
question about car models & double sided faces
04-22-2008, 12:48 AM,
#16
 
The F1-02 collision box (collision.joe) isn't big enough. The collision box should encompass the wheels, but with the F1-02 it stops at the edge of the body. This makes it so the wheels are able to get up onto vertical walls, and thus the flipping.
Reply
04-22-2008, 09:58 AM,
#17
 
joevenzon Wrote:The F1-02 collision box (collision.joe) isn't big enough. The collision box should encompass the wheels, but with the F1-02 it stops at the edge of the body.

i always suspected that. i have no idea how to adjust the collision box so can somebody please fix it? thanks. btw, the t73 suffers from the same problem.

--alex--
Reply
05-05-2008, 08:11 PM,
#18
 
joevenzon Wrote:The F1-02 collision box (collision.joe) isn't big enough. The collision box should encompass the wheels, but with the F1-02 it stops at the edge of the body. This makes it so the wheels are able to get up onto vertical walls, and thus the flipping.

i thought a little bit more about this and i don't think you would want the collision box to encompass the wheels. the collision box is static (as is the body) but the wheel positions are not so if you enlarge the collision box you would sometimes get collisions when you shouldn't. this could be solved if we make the wheels themselves collideable. i'll take a look at the code and see if i can figure out what changes need to be made (but, alas, i still haven't figured out how to make only selected textures double-sided).

--alex--
Reply
05-06-2008, 10:47 PM,
#19
 
alex25 Wrote:i thought a little bit more about this and i don't think you would want the collision box to encompass the wheels. the collision box is static (as is the body) but the wheel positions are not so if you enlarge the collision box you would sometimes get collisions when you shouldn't

Hmm, let's make sure we're talking about the same thing: what I meant was, you want the collision box to encompass the wheels on the forward/backward left/right axes, but not on the up/down axis.

Now, sure, sometimes you'd get collisions when you technically shouldn't, but that happens anyway since it's not like your car body is actually a box, and the error is small and not really a big deal.

The important thing is to make sure that the collision box will stop the wheels (which are just raycasts) from being able to get up on world geometry that they aren't supposed to, like walls and stuff.
Reply
05-07-2008, 12:18 AM,
#20
 
joevenzon Wrote:Hmm, let's make sure we're talking about the same thing: what I meant was, you want the collision box to encompass the wheels on the forward/backward left/right axes, but not on the up/down axis.

sounds good, but since i don't know how to change the collision box it's all academic until somebody actually changes it.

--alex--
Reply
05-08-2008, 06:17 PM,
#21
 
joevenzon Wrote:
alex25 Wrote:i still think it would be nice to enable double-sided textures only for selected objects

Yes, that's a good point, double sided-ness makes more sense as a per-object flag instead of a per-track flag. I'll add it to the issues list....

it turns out it's trivial to implement double sided-ness on a per texture. basically i just extended the blend flag to mean one for transparent blended texture and 2 for double sided texture.

this is the patch:

Code:
Index: include/objects.h
===================================================================
--- include/objects.h   (revision 1989)
+++ include/objects.h   (working copy)
@@ -72,7 +72,7 @@

        list <OBJECTNODE> object_list;

-       OBJECTMODEL * AddModel(string modelname, string texname, bool mip, bool fullbright, bool skybox, bool blend, JOEPACK * pack);
+       OBJECTMODEL * AddModel(string modelname, string texname, bool mip, bool fullbright, bool skybox, int tex, JOEPACK * pack);

        string path;

@@ -86,7 +86,7 @@
        OBJECTS();
        ~OBJECTS();
        void UpdateSettings();
-       OBJECTNODE * Add(VERTEX pos, float rotation, string modelname, string texname, bool mip, bool fullbright, bool skybox, bool drv, bool col, bool blend, JOEPACK * pack, float f1, float f2, float bl, float bm, float rr, float rd, SCENENODE * parent);
+       OBJECTNODE * Add(VERTEX pos, float rotation, string modelname, string texname, bool mip, bool fullbright, bool skybox, bool drv, bool col, int tex, JOEPACK * pack, float f1, float f2, float bl, float bm, float rr, float rd, SCENENODE * parent);
        void DeleteAll();
        void LoadObjectsFromFolder(string objectpath);
        void SetVerticalSkyboxTracking(bool vtsky) {verticaltrackingskyboxes = vtsky;}
Index: src/objects.cpp
===================================================================
--- src/objects.cpp     (revision 1989)
+++ src/objects.cpp     (working copy)
@@ -58,7 +58,7 @@
        game.settings.Get( "display.FOV", field_of_view );
}

-OBJECTNODE * OBJECTS::Add(VERTEX pos, float rotation, string modelname, string texname, bool mip, bool fullbright, bool skybox, bool drv, bool col, bool blend, JOEPACK * pack, float f1, float f2, float bl, float bm, float rr, float rd, SCENENODE * parent)
+OBJECTNODE * OBJECTS::Add(VERTEX pos, float rotation, string modelname, string texname, bool mip, bool fullbright, bool skybox, bool drv, bool col, int tex, JOEPACK * pack, float f1, float f2, float bl, float bm, float rr, float rd, SCENENODE * parent)
{
        {
                OBJECTNODE newnode;
@@ -107,7 +107,7 @@

        if (!found)
        {
-               object_list.back().model = AddModel(modelname, texname, mip, fullbright, skybox, blend, pack);
+               object_list.back().model = AddModel(modelname, texname, mip, fullbright, skybox, tex, pack);
                object_list.back().texture = texname;
        }

@@ -118,7 +118,7 @@

        d.SetToList(object_list.back().model->jmodel.GetDrawList());
        d.SetLit(!fullbright);
-       d.SetPartialTransparency(blend);
+       d.SetPartialTransparency((tex==1)?true:false);
        //d.SetDiffuseMap(object_list.back().model->jmodel.GetTextureHandle(0).GetTexture().GetTextureInfo());
        TEXTUREINFO texinfo;
        texinfo.SetName(path + "/" + texname);
@@ -139,7 +139,7 @@
                d.SetMiscMap1(texinfo);
        }
        //d.SetCull(game.track.GetCullFaces(), true);
-       d.SetCull(game.track.GetCullFaces(), false);
+       d.SetCull((tex==2)?false:true, false);
        //cout << "**************" << game.track.GetCullFaces() <<endl>jmodel.GetRadius());
        VERTEX objcenter = object_list.back().model->jmodel.GetBBOX().GetCenter();
@@ -161,7 +161,7 @@
        dir.LoadMultIdent();
}

-OBJECTMODEL * OBJECTS::AddModel(string modelname, string texname, bool mip, bool fullbright, bool skybox, bool blend, JOEPACK * pack)
+OBJECTMODEL * OBJECTS::AddModel(string modelname, string texname, bool mip, bool fullbright, bool skybox, int tex, JOEPACK * pack)
{
        OBJECTMODEL * oldfirst = model_list;
        model_list = new OBJECTMODEL;
@@ -171,7 +171,7 @@
        model_list->jmodel.Load(path + "/" + modelname, pack, true);

        model_list->fullbright = fullbright;
-       model_list->blend = blend;
+       model_list->blend = (tex==1)?true:false;
        model_list->skybox = skybox;

        //search for the texture in our texture db
@@ -239,7 +239,7 @@
                string extra;
                bool mip;
                bool fb, sb;
-               bool blend;
+               int tex;
                VERTEX p;
                float r;
                bool c, d;
@@ -282,7 +282,7 @@
                        fb = game.utility.bGetParam(o);
                        sb = game.utility.bGetParam(o);
                        //p.x = game.utility.fGetParam(o);
-                       blend = game.utility.bGetParam(o);
+                       tex = game.utility.iGetParam(o);
                        //p.y = game.utility.fGetParam(o);
                        //p.z = game.utility.fGetParam(o);
                        bl = game.utility.fGetParam(o);
@@ -307,7 +307,7 @@

                        if (m != "" && m != game.utility.GetEOFString())
                        {
-                               added = Add(p, r, m, t, mip, fb, sb, d, c, blend, packptr, f1, f2, bl, bm, rr, rd, parentnode.GetPtr());
+                               added = Add(p, r, m, t, mip, fb, sb, d, c, tex, packptr, f1, f2, bl, bm, rr, rd, parentnode.GetPtr());
                                //collision.AddCollision(added);
                                count++;
                        }
if there are no objections i can commit it to svn and start updating the tracks to take advantage of this feature.

--alex--
Reply
05-08-2008, 10:24 PM,
#22
 
having just implemented double-sidedness for selected texture, the next question would be: does it actually make any difference if we cull the back side or not? it would be a lot easier to just have double-sided textures by default (and i can't see any difference in performance actually).

--alex--
Reply
05-08-2008, 11:20 PM,
#23
 
Alex, I think you should go ahead and commit that. I don't see anything wrong with it. That seems like a reasonable solution.
Reply
05-09-2008, 02:02 AM,
#24
 
thelusiv Wrote:Alex, I think you should go ahead and commit that. I don't see anything wrong with it. That seems like a reasonable solution.
done. i've also updated bahrain and suzuka to use the new double sided textures.

--alex--
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)