Jump to content
  • Advertisement

Search the Community

Showing results for tags 'PhysX'.

The search index is currently processing. Current results may not be complete.


More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Categories

  • Audio
    • Music and Sound FX
  • Business
    • Business and Law
    • Career Development
    • Production and Management
  • Game Design
    • Game Design and Theory
    • Writing for Games
    • UX for Games
  • Industry
    • Interviews
    • Event Coverage
  • Programming
    • Artificial Intelligence
    • General and Gameplay Programming
    • Graphics and GPU Programming
    • Engines and Middleware
    • Math and Physics
    • Networking and Multiplayer
  • Visual Arts
  • Archive

Categories

  • Audio
  • Visual Arts
  • Programming
  • Writing

Categories

  • Game Developers Conference
    • GDC 2017
    • GDC 2018
  • Power-Up Digital Games Conference
    • PDGC I: Words of Wisdom
    • PDGC II: The Devs Strike Back
    • PDGC III: Syntax Error

Forums

  • Audio
    • Music and Sound FX
  • Business
    • Games Career Development
    • Production and Management
    • Games Business and Law
  • Game Design
    • Game Design and Theory
    • Writing for Games
  • Programming
    • Artificial Intelligence
    • Engines and Middleware
    • General and Gameplay Programming
    • Graphics and GPU Programming
    • Math and Physics
    • Networking and Multiplayer
  • Visual Arts
    • 2D and 3D Art
    • Critique and Feedback
  • Community
    • GameDev Challenges
    • GDNet+ Member Forum
    • GDNet Lounge
    • GDNet Comments, Suggestions, and Ideas
    • Coding Horrors
    • Your Announcements
    • Hobby Project Classifieds
    • Indie Showcase
    • Article Writing
  • Affiliates
    • NeHe Productions
    • AngelCode
  • Topical
    • Virtual and Augmented Reality
    • News
  • Workshops
    • C# Workshop
    • CPP Workshop
    • Freehand Drawing Workshop
    • Hands-On Interactive Game Development
    • SICP Workshop
    • XNA 4.0 Workshop
  • Archive
    • Topical
    • Affiliates
    • Contests
    • Technical
  • GameDev Challenges's Topics
  • For Beginners's Forum

Calendars

  • Community Calendar
  • Games Industry Events
  • Game Jams
  • GameDev Challenges's Schedule

Blogs

There are no results to display.

There are no results to display.

Product Groups

  • GDNet+
  • Advertisements
  • GameDev Gear

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Website


Role


Twitter


Github


Twitch


Steam

Found 9 results

  1. MehdiUBP

    Skating physics problem

    Hello y'all I'm making a small skating game, mostly because I'm interested in mechanics but I'm stuck with an orientation problem I can't figure out. To adapt the rotation of the skater with respect to its environment, I break the logic into several components: A PhysicRotation : Returns the Quaternion to go from the skater's transform.up to the normal of the point he's at Quaternion GetPhysicsRotation() { Vector3 target_vec = Vector3.up; Ray ray = new Ray(transform.position, Vector3.down); RaycastHit hit; if(Physics.Raycast(ray, out hit, 1.05f*height)) { target_vec = hit.normal; } return Quaternion.FromToRotation(transform.up, target_vec); } A velocity rotation: So that the character faces the direction he's going. This rotation is contrained to a plane Quaternion GetVelocityRot() { Vector3 vel = rb.velocity; if(vel.magnitude > 0.2f) { vel.y = 0; Vector3 dir = transform.forward; dir.y = 0; Quaternion vel_rot = Quaternion.FromToRotation(dir.normalized, vel.normalized); return vel_rot; } else return Quaternion.identity; } And finally, I an InputRotation that rotates the force applied for moving All of this is then tied in this function: void SkaterMove(Vector2 inputs) { Quaternion PhysicsRotation = aerial ? Quaternion.identity : GetPhysicsRotation(); // Rotation according to ground normal Quaternion VelocityRotation = GetVelocityRot(); Quaternion InputRotation = Quaternion.identity; Quaternion ComputedRotation = Quaternion.identity; if(inputs.magnitude > 0.1f) { Vector3 adapted_direction = CamToPlayer(inputs); Vector3 planar_direction = transform.forward; planar_direction.y = 0; InputRotation = Quaternion.FromToRotation(planar_direction, adapted_direction); if(!aerial) { Vector3 Direction = InputRotation*transform.forward*Speed; rb.AddForce(Direction); } } ComputedRotation = PhysicsRotation*VelocityRotation*transform.rotation; transform.rotation = Quaternion.Lerp(transform.rotation, ComputedRotation, RotatingSpeed*Time.deltaTime); } The thing works rather well, but always stumbles on one specific case. Here's a video I made the explain it better: Basically, when in the quarter, if the character's speed carries him in the air, he does a strange spin and and breaks its flow. I can't figure out where in the code I'm allowing it to do this. I've tried various tests, but I can't figure out where the problem is. Could anyone point me in the good direction ? Thanks !
  2. sprotz

    Car Spinout in Unity

    How do I go about adjusting the tendency for a car to spinout in Unity? The standard assets car physics have drifting but no spinout. I read that spinout is caused by the rear tyres losing traction but I think rear traction is dynamic, not static. Does it depend on lateral velocity of the rear wheels? I need at least a tutorial with code example (in javascript) if not a demo project. There is a similar topic here: https://www.gamedev.net/forums/topic/686144-car-skidding-behavior/ , but the answer is half complete. It says that braking shifts the car load to the front thus reducing friction on the rear wheels. Perhaps I could put in a code that accordingly adjusts friction on the tyres depending on braking or acceleration action, with braking reducing rear traction, and acceleration reducing front traction. Also making motor force directly proportional to the traction on a set of wheels, depending on whether it is rear wheel drive, front wheel drive or 4WD. Making a turn without accelerating or braking also shifts the car load in one spot, I assume, affecting traction on each of the four wheels because of suspension, and because lateral friction is higher than forward friction, making a sort of 'sideways braking', with areas of less load getting less traction. OK, I have found a pdf ebook that discusses vehicle physics in games here: https://nccastaff.bournemouth.ac.uk/jmacey/MastersProjects/MSc12/Srisuchat/Thesis.pdf And below is the solution I got combining these equations to calculate the weight load on each of the four wheels when cornering and/or braking. Hope this is right. So here is the procedure for each tyre: calculate the static load on each axle (front load/rear load equation), divide by 2 to get the load on one tyre Calculate and Add the forward weight shift(subtract for rear tyres), divide by 2 Calculate and add the Lateral weight shift (subtract for tyres on the side the car is turning), divide by 2 if centered center of gravity, if not, multiply by c/L for front tyre, by b/L for rear tyre
  3. So I'm making this basic 2D engine using Haxe Kha, and i just need to integrate some physics. Just basic collision detection and gravity on basic shapes, nothing too detailed. But i want to try not to write it myself, so i just want suggestions on what open source phyisics engines i could use, and that wont be impossible to integrate. Thanks in advance.
  4. Hi fellow game devs, First, I would like to apologize for the wall of text. As you may notice I have been digging in vehicle simulation for some times now through my clutch question posts. And thanks to the generous help of you guys, especially @CombatWombat I have finished my clutch model (Really CombatWombat you deserve much more than a post upvote, I would buy you a drink if I could ha ha). Now the final piece in my vehicle physic model is the differential. For now I have an open-differential model working quite well by just outputting torque 50-50 to left and right wheel. Now I would like to implement a Limited Slip Differential. I have very limited knowledge about LSD, and what I know about LSD is through readings on racer.nl documentation, watching Youtube videos, and playing around with games like Assetto Corsa and Project Cars. So this is what I understand so far: - The LSD acts like an open-diff when there is no torque from engine applied to the input shaft of the diff. However, in clutch-type LSD there is still an amount of binding between the left and right wheel due to preload spring. - When there is torque to the input shaft (on power and off power in 2 ways LSD), in ramp LSD, the ramp will push the clutch patch together, creating binding force. The amount of binding force depends on the amount of clutch patch and ramp angle, so the diff will not completely locked up and there is still difference in wheel speed between left and right wheel, but when the locking force is enough the diff will lock. - There also something I'm not sure is the amount of torque ratio based on road resistance torque (rolling resistance I guess)., but since I cannot extract rolling resistance from the tire model I'm using (Unity wheelCollider), I think I would not use this approach. Instead I'm going to use the speed difference in left and right wheel, similar to torsen diff. Below is my rough model with the clutch type LSD: speedDiff = leftWheelSpeed - rightWheelSpeed; //torque to differential input shaft. //first treat the diff as an open diff with equal torque to both wheels inputTorque = gearBoxTorque * 0.5f; //then modify torque to each wheel based on wheel speed difference //the difference in torque depends on speed difference, throttleInput (on/off power) //amount of locking force wanted at different amount of speed difference, //and preload force //torque to left wheel leftWheelTorque = inputTorque - (speedDiff * preLoadForce + lockingForce * throttleInput); //torque to right wheel rightWheelTorque = inputTorque + (speedDiff * preLoadForce + lockingForce * throttleInput); I'm putting throttle input in because from what I've read the amount of locking also depends on the amount of throttle input (harder throttle -> higher torque input -> stronger locking). The model is nowhere near good, so please jump in and correct me. Also I have a few questions: - In torsen/geared LSD, is it correct that the diff actually never lock but only split torque based on bias ratio, which also based on speed difference between wheels? And does the bias only happen when the speed difference reaches the ratio (say 2:1 or 3:1) and below that it will act like an open diff, which basically like an open diff with an if statement to switch state? - Is it correct that the amount of locking force in clutch LSD depends on amount of input torque? If so, what is the threshold of the input torque to "activate" the diff (start splitting torque)? How can I get the amount of torque bias ratio (in wheelTorque = inputTorque * biasRatio) based on the speed difference or rolling resistance at wheel? - Is the speed at the input shaft of the diff always equals to the average speed of 2 wheels ie (left + right) / 2? Please help me out with this. I haven't found any topic about this yet on gamedev, and this is my final piece of the puzzle. Thank you guys very very much.
  5. Hello i just started with PhysX, so far most things worked fine but now i'm trying to create PxTriangleMeshGeometry and my program crashes like 70% of the time. I followed the example from manual, basicly here's my code: // i'm using _mm_malloc 16 because i tough this may be the problem // but it didn't help PxVec3 *pVert = (PxVec3*)_mm_malloc(sizeof(PxVec3)*(v_verticles.size()), 16); PxU32 *pIndex = (PxU32*)_mm_malloc(sizeof(PxU32)*(_indices.size()), 16); for (UINT i = 0; i < v_verticles.size(); i++) pVert[i] = PxVec3(v_verticles[i].x, v_verticles[i].y, v_verticles[i].z); for (UINT i = 0; i < _indices.size(); i++) pIndex[i] = _indices[i]; PxTriangleMeshDesc meshDesc; meshDesc.points.count = v_verticles.size(); meshDesc.points.stride = sizeof(PxVec3); meshDesc.points.data = pVert; meshDesc.triangles.count = _indices.size(); meshDesc.triangles.stride = 3 * sizeof(PxU32); meshDesc.triangles.data = pIndex; // application crashes here on validateTriangleMesh // also when the application doesn't crash, it always returns invalid if (!in_gameMap->m_pxCooking->validateTriangleMesh(meshDesc)) debugMsg("invalid"); else debugMsg("valid"); PxDefaultMemoryOutputStream writeBuffer; if (in_gameMap->m_pxCooking->cookTriangleMesh(meshDesc, writeBuffer)) { PxDefaultMemoryInputData readBuffer(writeBuffer.getData(), writeBuffer.getSize()); m_pxTriMesh = in_gameMap->m_pxPhysics->createTriangleMesh(readBuffer); PxShapeFlags shapeFlags = PxShapeFlag::eSCENE_QUERY_SHAPE | PxShapeFlag::eSIMULATION_SHAPE; PxTriangleMeshGeometry cmg(m_pxTriMesh); m_pxShape = in_gameMap->m_pxPhysics->createShape(cmg, *m_pxMaterial, 1, shapeFlags); } When i simply remove validateTriangleMesh, application crashes later on cookTriangleMesh. Also I'm using PxConvexMesh for cylinders, app doesn't crash on this but validateConvexMesh also returns false. PxVec3 *pVert = (PxVec3*)_mm_malloc(sizeof(PxVec3)*32, 16); for (int i = 0; i < 16; i++) { pVert[i * 2] = PxVec3(sin(i*XM_2PI / 16.0f)*in_halfExtents->x, in_halfExtents->y, cos(i*XM_2PI / 16.0f)*in_halfExtents->z); pVert[i * 2 + 1] = PxVec3(sin(i*XM_2PI / 16.0f)*in_halfExtents->x, -in_halfExtents->y, cos(i*XM_2PI / 16.0f)*in_halfExtents->z); } PxConvexMeshDesc convexDesc; convexDesc.points.count = 32; convexDesc.points.stride = sizeof(PxVec3); convexDesc.points.data = pVert; convexDesc.flags = PxConvexFlag::eCOMPUTE_CONVEX; if (!in_pxCooking->validateConvexMesh(convexDesc)) debugMsg("invalid validateConvexMesh"); PxDefaultMemoryOutputStream buf; if (!in_pxCooking->cookConvexMesh(convexDesc, buf)) { _mm_free(pVert); return 0; } Why dos my application crash and why is validateConvexMesh returning false?
  6. Breakable object physics Let's talk about physics in the game. We will introduce breakable glass, door and wall to the game to make things not only more alive but also give you more choice about your path to reach each level goal. A building is locked down ? Maybe you just jump through a window to get in ! A door is lock and you haven't found the key ? Maybe you just blow that thing out of your way ! There's no exit ? Well crank your energy up and destroy that wall ! This is the kind of choice you will be able to do as long as you live with the consequence of making a lot of noise and attracting more attention to you and potentially increasing your awareness level. Remember that your global awareness is what make your next level harder and harder. Physics will allow for more interactive game play and better replay-ability. Let be honest to, when a game require you to keep a certain level of stealth, you will eventually want to go destroy everything and play careless so why not make this fun ! Frag, IEM and Gravity bomb The player, depending on the active character, will have access to a limited amount of grenade. You get a sneek peak about it in the video below. Frag grenade will allow you to destroy glass, door and wall too. 1 character have access to frag, another one have electromagnetic device that will shut down most electronic device and the last one will have a devastating black-hole type of grenade that will serve as a way to grab item at a remote distance or to simply make things vanish in another dimension ! More to come on those soon ! C# Break in parts Our script rely on unity internal physic engine, which is quite good. Physics can become very CPU intensive so a lot of testing will be required to ensure smooth gameplay. I don't intend to go to far away into destruction. This is not a procedural "red faction" destruction system ! So destruction will happen, but in a limited amount of location. Destroying everything to get through is NOT an option. That said, i'm happy with the script performance and how it work. Magnitude of an impact For of all, the script take into account the magnitude of a hit. If the hit is too weak, the object won't break. Each object have their own breaking point which me require to walk into, run into, shoot at it, trow a grenade or use a special ability. Parts physics Once an object is broken, it fracture into multiple parts. The glass in the example video is make of 160 rigidbodies and it still perform well. Each part take into consideration their surrounding. Depending on how many piece stick together, the script determine if the piece can hold in place. The system also check for "framed" part. For a window, the framed parts are the object around the edge that would be hold in place by its frame, for a door it would be the part connected to the hinge. Those part don't fall by them self since they are hold in place by another object. Those part need to be hit again to fall and each sets of broken part need to be connected, within a certain range, to a framed part to be considered structurally stable. Basically that mean that a broken part cannot float in the air if it's not link to enough pieces and that a large glass would break realistically even if you hit limited area because the weight and size of the part would make them fall in real life. Then again, this is not a fracture simulator and we can't go too far into reality. It remain a game, so the main goal is to have fun with the system and to have smooth gameplay. The focus is about the gameplay feature or having more choice, more path and more replayability. Explosion shock-wave ! Each explosion in the game come with a shock-wave effect. The shock-wave, in my own unscientific terms, is the air getting compressed and the explosion expanding over time. That mean that an object closer to an explosion will get hit faster than an object located further. On top of that, we take into consideration the distance between the explosion and the object to determine the amount of force received by the affected object. Obstruction is also considered, if something explode and there is object between you and the explosion, you will receive less damage. The shock-wave introduce a very important time factor to the game-play. Making thing explode at a distance and have a split second to get out of the way may be a life saver for you or the AI. See and be seen The video showcase a turret being able to see you through glass and it shoot at the player destroying the glass. This behavior will of course be extended to AI but be aware that militarised zone or city will benefit from upgraded unit that may have heat sensor and a turret may just decide to kill you through a wall or a door if you are not cautious enough ! Soldier may also be equiped with those special google. The game AI have nightvision and heat sensor to track you down. More to come on that in a futur post. Let me know what you think about the feature or share your though about current game that use physics such as RB6 ?
  7. Context : Unreal engine 4 and Big Space ships with box collision. What are the advantages one can get by using PhysX over say UE4's inbuilt sweep and collision system? Is PhysX implementation used in Ue4 accurate enough to have player controlled, Deterministic, gameplay physics rather than just decorative destruction or random behaviour? Is primary purpose of PhysX in Ue4 asthetics only? e.g. ragdoll, apex destruction. or is it accurate enough to have a meaningful gameplay without glitching out. I see there are a few quirks with physX like depenetration solver introducing quite huge depenetration velocity etc. but on the other hand using native sweeping collision feature of Ue4 leaves you to manually handle all the kinematics calculation which can be quite difficult when there are quite a few collisions at the same time on a single object. So like said in the context , if I had to make a giant space ship (which is basically a box) which might be more preferrable PhysX or Collision sweeps and why?
  8. Hi! How could I ignore the collision between an PxRigidDynamic and a PxRigidStatic? I got them on different groups and masks and I receive the collision between them on CustomFilterShader but I can't make them ignore the collision.
  9. In PhysX 3.3.4, convexmesh\trianglemesh\heightfield should be cooked before use, and they could be cooked offline or at runtime. According to Geometry, we can cook a geometry in two manners: offline manner by streaming PxDefaultMemoryOutputStream writeBuffer; cooking.cookTriangleMesh(someDescription, writeBuffer); PxDefaultMemoryInputData readBuffer(writeBuffer.getData(), writeBuffer.getSize()); PxTriangleMesh* aTriangleMesh = physics.createTriangleMesh(readBuffer); or runtime manner by cook api PxTriangleMesh* aTriangleMesh = theCooking->createTriangleMesh(meshDesc, thePhysics->getPhysicsInsertionCallback()); I should use the offline manner to achieve the best performance. I read the source code of PhysX and found them identical, except for an extra stream in offline manner containing data generated at cook time. So to speed up performance, should I save the stream to disk and recovery the cooked data at runtime to make cook actually "offline"?However, Serialization says that So the stream generated in the offline cook manner should not be stored at disk. If that is the case, what does the redundancy stream for?If I use the PhysX binary serialization mechanism, how to make the cook procedure offline and achieve the best performance?
  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!