Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

290 Neutral

About lubby

  • Rank
  1. lubby

    Feature chat: Type/member annotations

      I did not want to re-architect the code flow, so ended up using the private types to enable exposed variables, this is simple enough as I have the asIObjectType pointer available from each instance. This is sufficient enough for my current use case but won't hold up for more advanced techniques. So if you do decide to expose the metadata via the asIObjectType that would be great.
  2. lubby

    Feature chat: Type/member annotations

      Fortunately this thread is active today, I just came looking for a solution to flagging user editable class variables with metadata. const char *CScriptBuilder::GetMetadataStringForTypeProperty(int typeId, int varIdx); // Expects the type and index for that type Though when I need to peek at my user editable values CScriptBuilder is long gone out of scope. Additionally, I am using    int count = asIScriptObject::GetPropertyCount() aslScriptObject::GetAddressOfProperty(i); // Traversing all properties These two functions don't actually pair up without some work. What would be great is aslScriptObject::GetPropertyMetadata(i) and friends!      
  3. lubby

    RegisterObjectMethod help

      Expert enough to pick that up. Thanks it fixed the build script failure as you could expect.   After passing the build script stage I have changed my registration call to exactly match the (minus the virtual) method, its still got serious issues, but I think I see what's going on now. Thank you again for the sanity check!  
  4. lubby

    RegisterObjectMethod help

    Hi all,   I feel like a right beginner with this question. So apologies. I have had a real hard time finding concrete examples or documentation flow to learn the basics, so thus far I have struggled by - by using copy and paste from the samples and lots of trial and error.   So I am trying to register this object method   class TransformObject { public: virtual const Vector4& GetPosition() const; } The only way I have been successful in registering this method is as such... RegisterObjectMethod("TransformObject", "Vector4 GetPostion() const", asMETHOD(TransformObject, GetPosition), asCALL_THISCALL); ASSERT(r>=0, "Error"); Vector4 is a class and is registered as an object type like so... RegisterObjectType("Vector4", sizeof(Vector4), asOBJ_APP_CLASS_ALLFLOATS | asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_CAK); ASSERT(r>=0, "Error"); Using scriptBuilder to build the script containing this line... Vector4 position = self.GetPosition(); the following errors are output  movabletest.as (18, 30) : ERR : No matching signatures to 'TransformObject::GetPosition()' movabletest.as (18, 25) : ERR : Can't implicitly convert from 'const int' to 'Vector4'. Can anyone point me to my error please. Really perplexed.   Cheers!!
  5. lubby

    NVidia PhysX question

    Its prob exactly the combination of what was posted above. When you set an invalid parameter in PhysX it should default to something valid, or just fail its creation. Please call pRigidBody->GetMass() on the body you created with the negative mass - once it has reported the negative mass error. This will give you a starting point to begin to tune values from.
  6. Fantastic, tested and gave me what I wanted. Thanks for the spot on reply.
  7. Hey there. I am a little stuck on what may just be a simple query. Here is hoping that someone out there in GD.net land can help. I have a D3DXHANDLE it's a handle for a D3DXEffect technique, from this handle I need to be able to reverse lookup the technique name. I am doing this so that I can link up artist friendly technique names (string) to an index in an array of initialized techniques. All techniques for an effect are created at init time and parsed with FindNextValidTechnique() which returns the handle only having no concept of technique name. Aside from this I could create the techniques using GetTechniqueByName("Artist friendly name") only as they are required. In this case I need to dyn-realloc my technique arrays whenever a new technique is required, all issues aside I would rather not do this, especially if there is a simple solution to get the technique name from a handle. Thanks for any advice you can supply!
  8. Hi. So you need to disable contacts between your character controllers which form a box? 1. Bad idea. As character controller supports stuff you dont use. Collide and Slide and what not. This is what is causing your walls to push apart. Use a single kinematic rigid body with 6 NxShapes (boxes) forming the 'walls, roof and floor' - You cant use a single box as you want collision on the back face... 2. Now (this applies to both our methods) Enable contact reporting on your NxScene. So now you can actually do something with the contacts generated. 3. Now set up collision groups for the actors/shapes. see NxScene::setGroupCollisionFlag(). Add your actors to a group, and disable collision with that group versus itself -- NxScene::setGroupCollisionFlag(WALL, WALL, false); 4. Dont use character controllers for this. See #1. 5. Really. See #4. 6. True kinematic objects don't collide with each other. The character controller has a whole bunch of special code that causes push outs. Good luck.
  9. Quote:Original post by whogben Animations in my game are stored as a series of keyframes and I use linear interpolation to tween between them when running them on a character - but linear interpolation either makes the animator use extra of keyframes (harder for them (me in this case)) or looks jerky. I'd like to smoothly tween between the values, but I can't figure out an algorithm for this. ... What algorithms do you use that are smoother looking than linear interpolation? I'd really love to fix this :D Hi, you may want to try a quaternion SLERP, spherical linear interpolation. Its a 'little' more grunt work but should improve your interpolation over standard linear interpolation.
  10. lubby

    Keyframe animation in PhysX

    Quote:Original post by dietepiet - Create an NxActor per object and add all collision volumes as NxShape. - Each time a bone is updated by the animation, all connected NxShape's are updated using NxShape::setLocalPose( const NxMat34 &mat ). - The object's coordinate system is updated by PhysX simulation Is this the best(fastest) way to go for a RTS like game? It seems to me that updating the pose each frame for each moving NxShape might be expensive. Second, for NxShape::setLocalPose( const NxMat34 &mat ), I need the local transformation matrix with respect to the object's coordinate system. This is not something I need for rendering, as I only need the global transformation matrix. Calculating this separately will add an extra matrix multiplication per geometry or collision volume. Is this really necessary or is there a better way? Any advice from the experts? These steps are correct in any physics simulation. For your second point, an individual NxShape requires a local transformation matrix relative to the world transform of the rigid body. If you do not set this the local transform is set as identity. Making your shapes transform that of its parent rigid body. There is no way around this.
  11. lubby

    Rope simulation in PhysX

    For Viva Pinata : Party Animals, which used PhysX and had a stable rope simulation in one of it's mini games - bashing Pinatas with a big stick. I tried the old chain of joints trick but it was not stable enough. Eventually I used the PhysX cloth functionality, dynamically generating a hollow cylinder/tube and cooking as cloth. The cloth damping coefficient was the main param responsible for a stable simulation. Ended up, the coefficient could be calculated based on the mass of the object attached to the lower sheave and the number of vertices on the rope circumference (that being a cylinder cross section)
  12. 1. Instead of 'growing' the view frustum, grow the particle volume. 2. Instead of simulating a number of frames before rendering how about passing a larger time delta for the first frame, this way all particles should begin rendering at p0 + t rather than p0.
  13. Yep so what CableGuy is saying is that you can take your corners, top left(p1) and bottom right(p2) also take bottom left(p0) These points form the triangle that is coplanar with your walls normal. Using these three points create two vectors which lay on the walls plane. Now perform the cross product on these vectors to get the surface normal. Vector3 e0 = p1 - p0; Vector3 e1 = p2 - p0; Vector3 normal = CrossProduct(e0, e1);
  14. The process you have mentioned is in general the correct way to do it. The trick is to make your comparison with the unique set as quick as possible. Simply iterating all the unique list is in this case very slow, not idiotic but maybe niave :-) Hash map is simply the best way to proceed.
  15. Try and avoid any allocations during your main and rendering loop. Once your game has entered the Update, you want no allocations. Its a bad habit for performance to allow dynamically resizing anything during this time (stl included). If you know you are going to have that extra memory for a vertex buffer increasing in size then just create the buffers big enough to manage your worst case. People who are adding entries to vectors and such during Update generally reserve enough space for that worst case scenario.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!