• Procedural mesh & PhysicsInitConvex
    0 replies, posted
Hello, So I have been messing around with procedural meshes on GMod. I made a small terrain generator with Perlin noise. I have one problem, however. I am currently drawing the mesh via a matrix with the entity's pos/ang in my entity's draw function:         render.SetMaterial(mat);         local matr = Matrix();         matr:Translate(self:GetPos());         matr:Rotate(self:GetAngles());         cam.PushModelMatrix(matr);             obj:Draw();         cam.PopModelMatrix(); I am feeding in my vertices to the mesh, and when displayed, looks like the following: https://steamuserimages-a.akamaihd.net/ugc/963101357590541124/50EEE2EEBFC24B750FCAC50278760050E2584775/ On my initialization, I have:     if (SERVER) then         print(self:PhysicsInitConvex(vertices));     end     self:SetSolid( SOLID_VPHYSICS );     self:SetMoveType( MOVETYPE_VPHYSICS );     self:EnableCustomCollisions( true ); The physbox is being created successfully, because I am getting "true" in my console. HOWEVER, upon trying to walk on the terrain, it seems almost as if the entire chunk is flipped 180. The collision points aren't matching up to the mesh. My question is, can I just feed all my vertices into PhysicsInitConvex, or am I missing something?
Sorry, you need to Log In to post a reply to this thread.