Jump to content

bigd

Members
  • Content count

    18
  • Joined

  • Last visited


Reputation Activity

  1. Like
    bigd reacted to karl in Runtime Level Editor Thread   
    @bigd there's actually a method in pb_Object_Utility that will handle snapping to world coordinates for you:
    /** * Move vertices in world space. * pb - The pb_Object target. * selectedTriangles - A distinct list of vertex indices. * offset - The direction and magnitude to translate selectedTriangles, in world space. * snapValue - If > 0 snap each vertex to the nearest on-grid point in world space. * snapAxisOnly - If true vertices will only be snapped along the active axis. * lookup - A shared index lookup table. Can pass NULL to have this automatically calculated. */ public static void TranslateVertices_World(this pb_Object pb, int[] selectedTriangles, Vector3 offset, float snapValue, bool snapAxisOnly, Dictionary<int, int> lookup)  
  2. Like
    bigd got a reaction from Nyrow in Runtime Level Editor Thread   
    @Nyrow Face extrusion and translation, wireframe, adding material to a face, and flipping object normals are currently implemented. I'm currently trying to figure out face scaling, edge selection/translation, whole object translation/rotation/scaling/copy/pasting, and object serialization. After that, I'm not sure I'll go much further, even thought that's just scratching the surface of what Probuilder can do.
    In terms of when, I think I'm still a few weeks away from getting something ready to publish. My code right now is full of comments, debug statements, and wouldn't be too helpful to anyone in it's current state.
    Seems like there quite a few people like yourself interested in this, kind of makes me think I might need to set up a donation fund so I can purchase an actual license.
  3. Like
    bigd reacted to karl in Runtime Level Editor Thread   
    There aren't any that I remember off-hand, but the gist of it is:
    - Get handle rotation delta ( Inverse(previousHandleRotation) * currentHandleRotation )
    - Shift selected vertices to local space (subtract each position by the average of all vertices)
    - Multiply vertices by delta
    - Shift vertices back
  4. Like
    bigd reacted to karl in Runtime Level Editor Thread   
    Yes, that's correct.  The actual mesh is never modified, and two additional meshes are rendered "on top" of it.  The edge and face highlight meshes are rendered using a shader that pulls the vertices slightly closer to the camera in clip space so as to avoid z-fighting.
    Not quite that far - the edge and face highlight meshes are just used to show the user where things are.  The vertices and triangles that are used for operations are still pulled from the mesh.
  5. Like
    bigd got a reaction from karl in Runtime Level Editor Thread   
    Great! I was curious what the distinct vertices did, so this helps clears up that for me. I'll munch on this for a bit.
  6. Like
    bigd reacted to karl in Runtime Level Editor Thread   
    Ah okay, that's a custom wireframe I wrote for the editor.  I actually wrote a blog post about how I did that over here: http://parabox.co/blog/blog_entry.html?2015-01-28=wireframe.html
    As for the bad face highlight, that can be fixed by not assuming the distinct indices == vertex order.
    void RefreshSelectedFacePreview() { // Copy the currently selected vertices in world space. // World space so that we don't have to apply transforms // to match the current selection. Vector3[] verts = currentSelection.pb.VerticesInWorldSpace(currentSelection.face.indices); // face.indices == triangles, so wind the face to match int[] indices = new int[verts.Length]; for(int i = 0; i < indices.Length; i++) indices[i] = i; // Now go through and move the verts we just grabbed out about .1m from the original face. Vector3 normal = pb_Math.Normal(verts); for(int i = 0; i < verts.Length; i++) verts[i] += normal.normalized * .01f; if(preview) Destroy(preview.gameObject); preview = pb_Object.CreateInstanceWithVerticesFaces(verts, new pb_Face[] { new pb_Face(indices) }); preview.SetFaceMaterial(preview.faces, previewMaterial); preview.ToMesh(); preview.Refresh(); }  
  7. Like
    bigd got a reaction from GabrielW in Runtime Level Editor Thread   
    Managed to get some time to work this today. So far, so good.
    I think I'll tackle extrude or switching the object normals next, will let you know if I have any questions but open to hints/suggestions :-)
     
  8. Like
    bigd got a reaction from GabrielW in Runtime Level Editor Thread   
    Managed to get some time to work this today. So far, so good.
    I think I'll tackle extrude or switching the object normals next, will let you know if I have any questions but open to hints/suggestions :-)
     
  9. Like
    bigd reacted to karl in Anyone tackle in-game probuilder yet?   
    Hot off the "press"   http://parabox.co/probuilder/probuilder-api/html/
  10. Like
    bigd got a reaction from karl in Anyone tackle in-game probuilder yet?   
    You da man. Thanks Karl.
×