_id
int64 0
49
| text
stringlengths 71
4.19k
|
---|---|
6 | Creating stable tentacle structures I am using verlet integration to simulate some tentacles. So far it works great and I am satisfied with how it looks in general. Here is how a tentacle is built The very stiff sticks are colored red, in addition I added angular constraints of 180 in order to keep everything together. But still, sometimes this happens When forces are too big at the peak, it flips around and gets stuck in a very ugly state. Of course I could increase the number of iterations for satisfying the constraints, but then the tentacles get too stiff and the performance suffers. What can I do about this? Some ideas add more points at the peak more constraints overall limit possible forces maybe rethink my tentacle design completely? detect flip over and undo it |
6 | Why is there no standard 3d file format that saves models as (collections of) primitives? I have been looking around for a file format that saves models as a collection of primitives (Boxes, Spheres, Cones, Cylinders, etc.). After some research, I came to the conclusion that pretty much every standard available file format saves models as a collection of vertices and indices (and some other stuff like UVs amp materials). Real world example Why would one need a file format that saves primitives? Well, in my case, I am trying to build a game where I will need to import the physics separately. Since physics are optimized per primitive type, I would deem it wise to not just import everything as a mesh collider but make use of these optimizations. For context, I am using Three.js with Ammo.js (Bullet) running server side. Standard So the question really is, why is there no standard for this? Why isn't there a standard like SVG but for 3d models? I will probably end up writing my own format implementation, so it's not like it's holding me back. It's just that I am a bit cautious, since I feel that there probably is a reason for no such standard to exist. Related links Here are some links I came across during research http wiki.laptop.org go Physics File Format http bulletphysics.org mediawiki 1.5.8 index.php Bullet binary serialization Edit Since comments aren't for thanking people, I'll just do that here. Thanks to all of you that answered and commented, very insightful! Much appreciated! |
6 | 2D Motocross physics I'm looking into making a 2D motocross bike game with plausible physics. It should look like this For a first try, I've created only the player (a motocross driver) and the map (consisting of only straight lines no curves, to keep it simple). How should collisions between the motocross bike and the track affect the bike's position and velocity? The bike should rotate if only one of the wheels touches the ground and speed up if the back wheel touches the ground. Pretty standard bike game stuff. How do I achieve this behaviour? |
6 | Basic Box2D collision detection I don't understand how to listen for collisions in Cocos2D Box2D. Say I have two dynamic circle bodies. One is very small and the other is relatively large. When the small circle collides w the large circle I'd like to do something (play a sound for example). What's the best way to do this? I'm currently experimenting w the TestPoint method. Something like if(largeCircleBody gt GetFixtureList() gt TestPoint(smallCirclePoint)) collision happened... play sound etc |
6 | bullet character controller sliding down any slope gradient I've been experimenting with the btKinematicCharacterController. I've seen very old complaints that it has issues but I can't find anything recent stating that these issues remain (and nobody ever says what the issues were). The problem I'm seeing is that the character is sliding down slopes at absolutely ANY gradient. It will only stand still on level ground. If I have a ramp with a very gentle gradient it will slide slowly. I've found posts asking about this on the Bullet forums but haven't found any solutions. I've set the friction and rolling friction for both the ramp and character capsule to a very high value but it doesn't seem to impact the sliding. I'm sure there's something else I'm missing or is there something wrong with the controller's implementation of recoverFromPentrations (It seems to shift the object by the collision normal on the other surface which is necessary to avoid going through walls). |
6 | How to adjust my games speed to fps Hi so i am making a small sort of physics engine, but if your fps is really slow the physics will update slower and objects will move slower. How do i make the speed of objects greater if the fps is lower so that on a computer with 5 fps the object will land at the same time as on a 60 fps computer? (just with that slow framerate) |
6 | what is the difference between CCSprite and a PhysicsSprite? I am new to Cocos2D and I've realized that most of the codes written before the Cocos2d update used CCSprites. Recently I realized a lot of more recent codes after the update are using PhysicsSprite. What is the difference? What advantages does one have over the other, if any? |
6 | Aircraft trajectory prediction I have an aircraft that is controlled by player and i need to predict it's position at needed time. It's not a problem if the plane is just moving straight but most of the time aircraft is maneuring. So i came up with an aproximation that aircraft movement can be described as a helix. So i have a point A and linear velocity V 1 that aircraft had at a time of t 1. Point B and linear velocity V 2 that aircraft had at a time of t 2. In that approximation we may assume that V 1 equals V 2 so it will be a perfect helix. And i need to find a point C in that aircraft will be at a time of t 3. |
6 | Does client side prediction sync with the server in the past? I've spent some time now messing around and just trying to learn dead reckoning and client side prediction for the fun of it. Most of what I do doesn't need it, so i've never had a need to go down the path. I get how to predict the client and i've got a completely deterministic setup with a lockstep of 60fps for the physics on client and server. Both client and server use the same movement code, and i'm using constant velocity to reduce complexity. I also understand how to interpolate for corrections. I also have the server and client ticking at nearly the same time (as close as one can really get it). The problem i'm having, that doesn't seem clear to me in anything I've read (i'll put links at the end to a few things), is what does the client message sync against on the server? So, for example, the client is at 0, 0, 0, with a heading of 0, 0, 1 at tick 0. At tick 5 the client presses the button to start moving forward at 40u s and sends the message to the server. We'll say that the trip to the server takes 50ms and 50ms back. So the server gets the message at tick 8 (roughly), and here is where I am slightly lost. The client sent the tick they pressed the button along with the position and new velocity. Does the server do A. Look back at tick 5 and say "you're good b c you were where you should be at that tick" B. Check against tick 8 and say "well you where at 0, 0, 0 at tick 8, so you didn't start moving until then". It would seem with B, which is what i'm currently doing, that the server is always sending back a correction. B also has a bad side affect that when I stop, I'm almost never where the server is and the interpolation of this feels impossible to get right. While with A, it would seem I have to redo all collisions for that object from tick 5 thru 8 on the server, but this sends less corrections and would give a smoother feel. I understand that A is used for lag compensation when firing a weapon or taking some action that would affect other entities, but is that also used for motion? Things I've read http gafferongames.com http www.gabrielgambetta.com fpm1.html Various articles out of books and other websites that seem to skip past this detail Thanks in advance for any help. |
6 | Solids as high viscocity Liquids A friend of mine and I were discussing different idea for allow materials in a world to be destroyed in a very piecemeal fashion and he proposed the idea of representing solids as very viscious fluids. My intuition is that this would be either A) very difficult, or B) very resource intensive, but I am unsure. Is such a model feasible for an RPG adventure rpg fps? edit clarification The idea is for collisions and objects breaking to be handled by this system. To basically allow any object handled this way to be destructable instead of having scripted destroyable objects. |
6 | Looking for very simple implicit integration example I am trying to design a robust cloth system. I have no problem at all simulating things like that using forward integration such as euler, midpoint, runge kutta, verlet, etc. However, I just can't wrap my head around implicit methods. I don't understand how you formulate the equations in linear algebra terms. I'd really like to see a VERY simple tutorial, and an actual example of how to construct the equations, and then solve for a very simple system (for example, 3 particles connected by 3 springs). I looked into David Baraff's Large Steps in Cloth Simulation, and I can kind of follow it, but going from equations to code is a weak spot of mine. I can use a package like eigen to solve, but I'd also really like to see some code for something like conjugate gradient descent. I don't care about efficiency at the moment, I just want to be able to clearly understand what's going on. Thanks |
6 | Tracking Object Position Firing on a Trajectory How can I calculate the position of an object after "firing" it from a fixed point? I am to create a small game most likely with canvas (pure HTML, JS based) or Adobe Flash in which the player fires objects at other obstacles in order to clear them. |
6 | Calculate the leaning angle I have an object moving around, let's say it's a cycle. In cycle dynamics, when the object takes a turn, it often leans into the direction of the turn. I would like to simulate this. I'm using the equation atan(v 2 r g), where v is the current velocity, r is the radius of the turning circle and g is the gravitational force. I get r with v 2 a, where a is the current acceleration. However it doesn't seem to work right. In some cases it leans to the right direction, in others, it leans to the opposite, meanwhile the leaning should always be inwards. I've determined the direction where the acceleration force pulls the object with sign(velocity.y acceleration.x acceleration.y velocity.x) and multiplied the leaning with the result, but it has no effect. What am I missing? |
6 | Is it possible to correctly catch up a particle system simulation based on long delta time between many frames? I have a particle system with a physics simulation integrator based on delta time (elapsed time between frames) which is implemented on the GPU in a compute shader. I also have a frustum culling system implemented on the GPU. The frustum culling gives me the possibility to cull away draw calls and the dispatch calls for the particle simulation. The culling of draw calls works well, I also don't have a problem with culling the particle simulation when the camera is looking away. My problem happens when I want to catch up the particle system simulation when the camera looks back at the particle system after looking away for a while. What I do is accumulate the time passed while looking away, then I resume the simulation using all that accumulated time. The problem with this approach is that if the simulation is anything but a simple constant velocity change in one direction, the simulation just doesn't look the same as if the simulation was playing one frame delta at a time. From what I have read this is a common issue with using time elapsed between frames to simulate physics. What I wonder is if there's a different approach that can actually allow me to correctly play back many seconds of simulation (let's say 20 seconds) the same as if it was played one frame delta at a time? |
6 | Libgdx movement of scrolling background is not smooth even at 60fps I'm developing a game and I want to make a sliding background. The background is not scrolling smoothly. I logged the fps, but it was ok. This is my code, I don't know what I'm doing wrong, any ideas? public class MyGdxGame implements ApplicationListener private OrthographicCamera camera private SpriteBatch batch Texture back float offset 0f FPSLogger logger new FPSLogger() Override public void create() camera new OrthographicCamera(320, 480) camera.position.set(320 2, 480 2, 0) camera.update() batch new SpriteBatch() batch.setProjectionMatrix(camera.combined) back new Texture(Gdx.files.internal("back.png")) Override public void dispose() batch.dispose() Override public void render() logger.log() offset (400f Gdx.graphics.getDeltaTime()) offset offset 480f batch.begin() batch.draw(back, 0, offset) batch.draw(back, 0, offset 480) batch.end() Override public void resize(int width, int height) Override public void pause() Override public void resume() I uploaded the code to bring more information, I looked for on internet and a lot of people have the same problem, but I didn't find solution. I have almost finished the game, change the library will be a pity, any can help me? Thanks! This is the code https www.dropbox.com sh t26gt33wcex5izn AAD8 yBSOztZfHe4wzDPRjjQa |
6 | How should I make realistic electricity? I am currently designing electricity for my game. If you've ever played or seen Factorio, this is pretty much the exact way I want it to be. Okay, on to theory What I came up with is some sort of power source produces a certain amount of Watts per frame. Most power sources cannot store any energy, so at the end of the frame, it is all lost. Machines connected by wires to energy sources will perform a Dijkstra style flood fill from themselves through all connected wires, ignoring wires that have already been processed. The Watt cost will slightly increase for each wire it passes through (to simulate energy loss) and when it reaches a battery or power source, it will drain as much as it needs. If the source doesn't have enough, it continues to search for more power. If, by the end of the frame, it doesn't have enough Watts, it simply works slower or stops working entirely. After all machines have done this, all batteries will perform a similar flood fill, but ignoring other batteries, and will attempt to take ALL of the energy from sources (up to its storage capacity). Then, all power sources discard all energy. Is this how it actually works? I want to use numerical values, so just being connected to an energy source is not enough. Thanks. |
6 | Simulate wind affecting a boat using a 2D physics engine like Box2D or SpriteKit? I'm looking for a way to simulate the forces created by wind and how it affects a boat. In a nutshell if wind hits a boat (sailing yacht), the bow is aligning with the wind and if the wind is strong enough, the boat will then slowly start to move. I am not looking for a correct simulation of sails or alike. Just wind as it would affect a boat during maneuvers at slow speed. Here's what I have tried Make the boat just one body and apply a force this does not take into account the heavier stern versus the lighter bow. Make the stern a heavy body and the bow a lighter one and connect them with a fixed joint this will make the boat rotate if the same force is applied to both bodies but ignores the fact that once the boat is aligned with the wind, the force should be reduced. Create many (thousands) of very small objects with little mass and apply a force to them, simulating the wind "particles" and let them hit the boat this kills performance on slower devices. Maybe I am missing a very simple solution that would work good enough? |
6 | Steer a flock towards a target? Like in pikmin? Can a flock be steered towards a target ? I've seen that flocking behavior has the alignement behavior, but can it be directed and steered toward a goal ? http www.youtube.com watch?feature player detailpage amp v BKJyv4uqsWI t 305 |
6 | 3D Planetary gravity so i am making a thing in javascript and i want to have planetary gravity in my "universe". But when i use an equation to calculate the acceleration by gravity i get one number. That is how fast the object accelerates in the direction of the other object, but how do i convert a speed in one direction to a speed in the X, Y and Z axis? |
6 | How to handle jumping up a slope in a runner game? In an 2D endless runner, what should happen when the player is running "too fast" up a slope and jumps? For example, in a "normal" case .O. . ..O . . O If he is moving to the right slowly enough, he will jump upwards and land on the flat part of the surface. However, if he is moving too fast, the jump will have no effect as his forward motion will bring him back in contact with the slope before he can get high enough to pass over it. When the speed is sufficiently high, there will effectively be no jump. .O O Are there any known ways to solve this issue? I know it's physically correct , but are there techniques that other games use to overcome this in a reasonable manner? As a last resort I'll have to just remove all slopes that are too slanted. If you constrain the player to never jumping backwards. |
6 | How to handle player input with fixed rate variable fps time step? I've made a system which uses the ideas from "Fix your Time Step" in order update physics. I'm having trouble finding standard methods for dealing with this when user input affects player movement outside of a time step. If we want to integrate player movement within the "fixed time step, variable fps" system, I guess I would have to queue up player actions somehow, when accumulation hasn't yet completed. But then how do I integrate several different player actions within said timestep? IE lets say within timestep of N milliseconds, the player executes a move forward, move right and move backwards, where there is an infinite collidable wall in front. I could always calculate the last input, but in this case, it wouldn't be correct to do so. The player actually should be blocked by the wall, and then moving right and back would move them to the right, and back, to the right of where only processing the last input would lead. Similarly, if all movement was accounted for together, it might result in a player having an impossible vector for the final position, but if all moves were taken independently, there might have been a valid path (ie around a corner). If I process all inputs then the player made during the time step, it could conceivably be costly if they made a million tiny movements (collision check at each movement), though with exact physics (as far as a fixed time step simulation is concerned). Even if we thought the last bullet wasn't that bad, as soon as you add multiple players to the equation, it starts looking really bad, especially with a server. Are my only options to process all actions or only process a subset of them? |
6 | Impact of increasing physics simulation rate I am working one Mini Golf game development using Scenekit (iOS). To fix one of the problem with Scenekit, I have to increase the physics simulation rate by 4 times. Questions What is the impact on the CPU requirements? What are the common advantages and disadvantages of changing the physics simulation rate? What are the expected problems issues with such increase in the physics simulation rate? I would appreciate any suggestion on this topic. Thank you. |
6 | Implementing time step in main game loop So ive read both http gameprogrammingpatterns.com game loop.html and http gafferongames.com game physics fix your timestep and I kind of understand how I'm supposed to do it, but some parts are still blurry and I would like some guidance. By the way, I have programmed my game from scratch and i do not want to change to some framework or anything that has an built in main loop, i want to do this by myself. Anyway, this is what I have accomplished code wise, I will re produce my solution it in psudocode below. func createPlayer() oData Empty Object() oData.id oData.name oData.etc..... Player LoadSprite("filename", oData) Properties Player.oSprite.x Player.oSprite.y Player.oSprite.scale Player.oSprite.width Player.oSprite.height Methods (Self explanatory) Player.oSprite.width() Player.oSprite.height() Player.oSprite.centerX() Player.oSprite.centerY() return Player Startup oPlayer createPlayer() oWorld 1D array of objects which has identical properties and methods from createPlayer() Main game loop while(game) User inputs game userInputs(byref oPlayer) "Physics" jumps and world collission is done here. game Physics(byref oWorld, byref oPlayer) rendering, draws the world frame with all inputs and physics done beforehand game render(byref boWorld,byref oPlayer) This is how I "understand" what flow the loop should have t 0.0 dt 0.0 currentTime 0.0 accumulator 0.0 while(game) newTime Timer QueryPerformanceCounter() Im feeling like this need something more than just the QueryPeformenceCounter? frameTime newTime currentTime if (frameTime gt 0.25) frameTime 0.25 currentTime newTime game input() This is causing my game to get stuck here, i belive it has something to do with my type of timer while accumulator gt dt game physics(t, dt) how is the deltatime helping me in my physics? t dt accumulator dt alpha accumulator dt game render(alpha) I dont know what im supopsed to do with this. TLDR, what do i do with the t, dt in my physics? before i render? |
6 | Bullet Physics Applying Torques Effects not noticeable I am applying torques to a rag doll in order to make it move walk. For some reason, I am unable to view any effects when I use a call to rigidbody to apply torques even though these torques are pretty large i.e in the hundreds of Nm. When I start the simulation, the doll just falls and the torques don't seem to have any effect. When I apply torque impulses however, there is a huge effect and the rag doll blows up because the angular velocity component becomes large that my velocity damping factor multiplies it and the torque impulse becomes huge. I seem to notice effects of the torque though when I pause the simulation and then resume it after some time. Am I missing something when I am trying to applying torques? I know that when applying torque, it accumulates the torque value rather than updating the angular velocity directly. I'm applying torques at every internal tick callback. I'd be happy to supply necessary code. Thank you all. |
6 | LOVE Physics Breaking Joint Chains (LUA Box2D) Wasn't sure whether to post here or on SO so please move if needed. I've been having a look into the box2D physics API provided by LOVE to try and create a swinging flail or weighted rope but I'm having some trouble keeping the jointed elements close together. So far I've made a series of circular bodies and linked them together using revolute joints with the first element being static and the final element being slightly larger heavier to act as a weight. The code to generate each link is as follows for i 1, segments, 1 do link if (i 1) then link.body love.physics.newBody(world, xpos, ypos, "static") Starting link else link.body love.physics.newBody(world, xpos, ypos, "dynamic") end if (i segments) then link.shape love.physics.newCircleShape(endlink radius) Ending link else link.shape love.physics.newCircleShape(link radius) end link.fixture love.physics.newFixture(link.body, link.shape) Fix bodies to shapes table.insert(chain,link) ypos ypos link distance Place next link further down, keeping x position end And the code to join each link for i 2, chain, 1 do x1,y1 chain i 1 .body getPosition() First link position x2,y2 chain i .body getPosition() Second link position chain i 1 .join love.physics.newRevoluteJoint(chain i 1 .body, chain i .body, x1, y1, x2, y2, false ) Join the two with a revolute joint end And this works quite well, producing a chain like this The next step is to move the chain, I'm currently moving the first static element and having it "drag" the rest of the links along with it using the following code position vo.add(position, velocity) Vector addition add velocity to current position to get new position chain 1 .body setPosition(position.x, position.y) Update the first link position This works fine for slow speeds (chain currently moves towards mouse cursor) but any rapid movement causes everything to fall apart. Is there anyway to easily keep the elements close together? I've tried adjusting the weights and world gravity but couldn't see any difference, I've also thought about applying a force to each element when the first one moves but that doesn't seem quite right. Thanks Solution (Thanks to NauticalMile) Change the previous position update position vo.add(position, velocity) Vector addition add velocity to current position to get new position chain 1 .body setPosition(position.x, position.y) Update the first link position To a velocity update and have Box2D handle the movement chain 1 .body setLinearVelocity(velocity.x, velocity.y) |
6 | How does server correct late input Imagine the following scene The height one player can reach on jumping depends on how much time the button for jumping is pressed. When the player jumps, the input is sent to the server and physics are updated. Now, imagine that for some reason, one input packet is lost or due to lag it begins to arrive late. From the point of view of server, the player is not jumping anymore, and its character will start its fall. Every other client will receive this information and let the character fall. Then, a new packet arrives that corrects this problem. From the perspective of the player, the character is still jumping. Maybe, thanks to this extra input the character can reach a higher slope. But from the point of view of the server and rest of clients, it wont make it. This could happen, but online games that i have played (except for long jumps and high lag) it doesnt happen. My question then is How does the server handle this situation? It cannot wait forever for input, it must update physics and acknowledge other clients on what's going on. |
6 | How can I move a ball to a clicked location using physics forces? I have a ball as a sphere in my game and I'm viewing it from top down view. The ball is a rigid body. When I click somewhere on the screen, I want the ball to be moved towards that direction using physics forces. The ball needs to move only on the X and Y axes, the Z axis can be ignored. Here is what I tried, but gives me some weird results. The script is attached to the ball Use this for initialization void Start () rb gameObject.GetComponent lt Rigidbody gt () void Update () Vector3 v3 gameObject.transform.position Vector3 v3Mouse Input.mousePosition Vector2 pointA new Vector2(v3.x, v3.y) Vector2 pointB new Vector2(v3Mouse.x, v3Mouse.y) float Angle Vector2.Angle(pointA, pointB) float angleRad Angle (Mathf.PI 180) Debug.Log ("Angle " Angle) float dx Mathf.Cos (angleRad) 10 float dy Mathf.Sin (angleRad) 10 if (Input.GetMouseButtonDown (0)) rb.velocity new Vector3(dx, dy, 0) What should I do here? When I click on the top of the screen, the ball should move up toward the mouse, and in all the other directions. Any ideas? |
6 | Creating shattering effects without having to use actual physics? For certain effects like glass shattering and falling objects cracking to reveal their inner contents, are there any tricks or ways to implement these fracture physics without having to use actual physics simulation? Also, what are the trade offs if I don't use real physics simulations? Since the effects don't really require exact simulation, an actual physics simulation may be too expensive and wasteful. |
6 | how to ignore physics collision of some objects in box2d I know this sounds silly but I would like some objects to follow physics while others not to collide each other. I tried to achieve them by setting their position exclusively. But then it will ignore all physics. Is what I am trying to do even possible? |
6 | How do I properly use multithreading with Nvidia PhysX? I'm having a multithreading problem with Nvidia PhysX. the SDK requires that you call Simulate() (starts computing new physics positions within a new thread) and FetchResults() (waits 'till the physics computations are done). Inbetween Simulate() and FetchResults() you may not "compute new physics". It is proposed (in a sample) that we create a game loop as such Logic (you may calculate physics here and other stuff) Render Simulate() at start of Render call and FetchResults at end of Render() call However, this has given me various little errors that stack up since you actually render the scene that was computed in the previous iteration in the game loop. Does anyone have a solution to this? |
6 | Ideas for 2D Water Simulation I am looking for any input on simulating water in 2D, against a rather large (call it) blocked not blocked array (viewed from the side). I have come up with the following ideas Cell Automata Do a massively parralel simulation on the CPU, using cell automata. With rules as simple as If there is a cell open to the bottom move to it. Check the left and right cells, choose a random one out of the two and move to it. Pros Simple to implement. Meaningful deterministic in a multiplayer system. Cons Probably really slow. Not convincing. Fluid Dynamics on the GPU Perform a rough approximation of fluid dynamics on the GPU against a texture like the following R G B A vX vY NULL Density Pros Probably really fast. Could be quite convincing. A further pixel shader could render it directly. Cons Difficult to implement. Difficult to tweak. I can't allocate a single texture the size of my level. I could overlap the grid areas, but this would add further complexity. Particles Use particles to simulate the water. During rendering using additive blending and then apply a multiplication function to the alpha channel to give the water crisp edges. Pros Will probably look nice. Easy to implement. Easy to render. Meaningful in a multiplayer system, although would require quite a bit of bandwidth to transfer. Cons Inter particle effects will probably be slow (neighborhood lookup). Could lead to water 'leaking' through solid spaces (because the solid space is small, e.g. 1px). Could lead to strange holes in the water depending on the particle size. Both of the above could be mitigated by allowing particles to drift closer together than their real size, however would cause problems with the inter particle and particle landscape performance. Any further ideas? Note This is an approximation, I am not looking for physically correct water here just something that 'is good enough' (bonus points for quick and dirty). The game is multiplayer, so unfortunately the whole level needs to be simulated continuously. |
6 | What does maximum normalized frictional force mean in this tutorial? I tried following this tutorial https nccastaff.bournemouth.ac.uk jmacey MastersProjects MSc12 Srisuchat Thesis.pdf, but in page 19 I ran onto a problem I don't understand the step 4. It is also not explained before. Could somebody explain what is it and what values may be used? |
6 | How do I prevent a KActor from changing the orientation of its Z Axis? So I have an object that inherits from KActor that I would like to behave as a dynamic physics object, but I want its Z Axis to remain upright, but very stiffly. I've tried the bStayUpright that triggers the "Stay Upright Spring". The problem is, it's a spring, and the object in question oscillates into position when I want it to remain oriented properly without wobbling. In the image above, the yellow block has fallen onto the gray box, and it is currently pivoting about the contact point as it tries to right itself. Should I be tweaking the StayUprightMaxTorque and StayUprightTorqueFactor parameters, or should I be using a Constraint of some sort? |
6 | Rotate a rigid body not around its centre of mass I have a rigid body (a boat) whose centre of mass is towards the front of the object. However, this makes the rotation look strange as the rudder that is turning the object is at the back of the boat so the rotation would be around that point. How can I rotate the object from the a separate point (using forces) without changing the centre of mass? Applying a force at a location still causes the object to rotate around the centre. In real life, you need to pin down the point that you want to rotate around, forcing the object to rotate around that point. This would suggest using constraints but I can't figure out how that would work. You sort of need the rotation point to act as a hinge, but when I apply a suitable constraint, but that would just block the rotation rather than convert it into a rotation around the new point. I want to resolve this using physics driven operations in Unreal Engine 4. I don't want to move the Centre of Mass, admittedly for not a particularly good reason, but this still feels like a valid question even if that was an option what if you want to rotate around two different points. |
6 | Solving constraints joints in 1D For n points moving in 1 dimension. Position and velocity are known for each point. Each frame a basic integration is done for each point velocity forces timestep forces 0 position velocity timestep Each point (except for the first one) is attached to the point following it (e.g to its right) with a distance joint of the form point2 point1 lt distance amp amp point2 point1 gt 0 Which means that the points shouldn't be further appart than distance or closer than 0. Energy should be conserved, i.e a point should be able to push pull another. I tried to solve every constraints with impulses, but it messes with velocities. (at least the way I did it..) Searching around, I found a lot of resources but I'm unfortunately not able to understand all of it. If anyone can give me a general idea starting point ? |
6 | Need physics algorithm for modeling ceiling collapse in voxel based game I'm looking for algorithms on how to model the physics of cave ins collapses for a game idea I am working on. The game allows the player to extensively mine 3D voxel based asteroids, and I want areas that are insufficiently supported to collapse under their own weight. Making the problem even more challenging, gravity will be non uniform (the direction it pulls will depend on where a given voxel is in relation to the asteroid's center of mass), and the number of voxels in the asteroid will be too large to model them all individually (I am using a sparse voxel octree to model the asteroid). Hopefully, someone will be able to provide links to articles discussing suitable algorithms, or can provide ideas on how to solve the problem. If you need more details, please ask. Edit 1 It does not need to be very accurate, I'm looking for something that would be a reasonable approximation for a Minecraft or Dwarf Fortress style game. I am mostly interested in how to determine where sections should break off when blocks are added or removed, moving the bodies after they break isn't part of this issue. Edit 2 My initial idea was to calculate the force on each block then iteratively distribute the forces amongst neighbors. However, this would require an entry for each block, while only blocks on the surface have entries in the data structure. Modeling all blocks on the scale I want would likely be prohibitive I would like to have bodies of at least 10,000,000 voxels, of which 200,000 will be on the surface and need to be stored. |
6 | What is the Shannon rule law when talking about game physics? I've been reading some articles on game physics and came across subjects such as fixed timestep (article). Some of the articles I read mention the "Shannon rule" or "Shannon law" in relation to the length of the timestep. Example quote Your timestep should be at least 1 120 seconds or smaller because of the Shannon rule ... Here's an answer here on Gamedev that mentions it. Some quick google searches for "Shannon's law" doesn't seem to yield much result except for this wikipedia article but I'm not sure if that's what is being talked about here. So what is the Shannon rule Shannon law? |
6 | Is restitution the wrong value, to make bouncing objects? I have been experimenting with Bullet. Specifically I was modifying the Hello World tutorial, to make the ball bouncing. The first thing I noticed is, that I need to set both the restitution of the ball and the ground above 0 to make the ball bouncing. For a simple setup, with two objects, this seems fine. However, for larger simulations I fell like, restitution is the wrong way, to make bouncy objects. Here are my reasons Reason 1 Consider three objects ball, box and ground. ground is just some plane. box is a box, which is not supposed to be very bouncy, thus its restitution is near or equals zero. ball is supposed to be bouncy, so I give it a restitution of 0.5. If now the ball collides with the ground, it only actually bounces, if the ground also has a restitution higher than 0, so let's give it a restitution of 1. So our ball is bouncy as expected, when colliding with the ground. When it collides with box it won't bounce, because the box has a restitution of 0. If we give box a higher restitution, the ball will bounce from it. But now we have a different problem. If the box collides with the ground, it will bounce off, but it isn't supposed to. I see no way, with restitution only, to make this scenario work. Reason 2 Restitution describes the amount of energy, that remains as impulse after a collision. The rest of the energy goes into deforming the colliding bodies and other side effects. If we now look at a typical bouncy object, like a rubber ball, we see that they are easily deformable (compared to less bouncy objects). When the rubber ball collides with something, it takes up energy from the collision, by being deformed and then goes back into its original form, thus releasing the energy taken up during the collision and bouncing back off. The solution (?) Reason 2 suggests, that a bouncy ball (like a rubber ball) shouldn't have a restitution close to 1, but rather be elastic (thus being deformed and then going back to its original form), to model bouncy objects as expected. The way to model this in Bullet, would be a soft body and I think it would be the way to go, in such a scenario. The actual question The text above looks more like an answer than a question, so here's the question I'm trying to ask I'm really unsure, whether this is right. Are soft bodies really the better way for bouncy stuff or am I just mistaking the principle of restitution? |
6 | Javascript Jumping Physics I have asked questions for this project before, but the jumping physics are a bit messed up. I cannot jump unless I hold down the W key, and then it just teleports me upwards. Does anybody know how to fix this glitch? Here's the code var canvas document.getElementById("canvas") var ctx canvas.getContext("2d") var x 1 var y 0 var xPos 0 var yPos 0 function updateVariables() x x 0.9 y y 0.9 y y 0.5 xPos x yPos y function clear() ctx.clearRect(0,0,600,600) function Draw() collisionCheck() clear() ctx.fillRect(xPos,yPos,10,10) ctx.fillRect(0,canvas.offsetHeight 0.7,600,200) window.requestAnimationFrame(Draw) function collisionCheck() if (yPos gt canvas.offsetHeight 0.7 10) yPos canvas.offsetHeight 0.7 10 function right() x 2 function left() x 2 function jump() y 20 function detectKeys() document.onkeypress function (e) e e window.event console.log(e.key) if (e.key "d") right() if (e.key "a") left() if (e.key "w") jump() window.requestAnimationFrame(Draw) setInterval(updateVariables, 1) setInterval(detectKeys, 1) lt canvas id "canvas" width "500" height "140" gt lt canvas gt |
6 | How to simulate backspin or topspin in a box2d billiard game? I am designing a simple billiard game with box2d. I think I can easily simulate hitting left or right side of a ball. Since box2d is not 3D, however, I am not sure how to simulate hitting upper or lower part of ball with a cue. In case you are not familiar with the game. If the ball is hit on its upper part, it's still going forward after hitting another ball. But when cue hit on its lower part, it should backspin as soon as striking another ball. Is this simulation possible with box2d? If so, a hint or reference will be appreciated. |
6 | Find vector tangent to circle through a point C2 and P1 are known points. Radius of circle C2 is also constant and known. I am trying to find point T to eventually construct line p1 t, which is tangent to circle c2. I have made an attempt involving bisecting c2 p1 at M, and performing trigonometric operations to find measure of angle TMC2. Then, I found the difference in x and y coordinates from m.x and m.y using a polar form to cartesian (polar angle tmc2 and length of tm c2m 1 2 c2P). After this, I normalized vectors c2P and added the difference in x, normalized the vector perpendicular to c2p and added the difference in y. This approach seems very convoluted for such a simple task. Are there any basic vector operations to save time and processing power? Thank you |
6 | Rotation of a 3D ball on a plane This used to be on the physics stack exchange but I was told to put it here I'm making a game (with physics) and I have a 3D ball rolling down a flat plane. It moves perfectly fine, but the rotation is messed up. It seems way too fast, and the axis seems to be all wrong. Here's the code that runs every tick (20 times per second). (normal is the normal to the plane, acceleration is gravity vector projected onto the plane, in m tick2, and velocity is the velocity in m tick.) vec3 rotationAxis normalize(cross(normal, acceleration)) quat newRotation rotate(oldRotation, length(velocity) sphereRadius, rotationAxis) rotate by v r radians about the rotationAxis I'm not sure why this doesn't work, since according to angular mechanics, v r and v t r (and t 1 since velocity is in meters tick). Am I doing something wrong? Why is the rotation so much faster than it should be? And is my axis of rotation correct? Rephrased in a more physics way, is this correct in 3D hat x frac hat N times vec a hat N times vec a Delta theta textrm about hat x frac v r Delta t And if it is correct, then what s wrong with my code? |
6 | How to program friction in an air hockey game in Cocos2d x 3.11? I'm developing a simple air hockey game, and I have a question about friction of puck and puddles with the game scene. How can I do that? I'm using cocos2d x default physics engine, and the friction setting of physic bodies only applies when they collide. I've found an old air hockey example project, but it seems that it's ported to cocos2d x 3.x so it doesn't use built in physics engine. |
6 | gravity simulation implementation this.attract function () for (let i 0 i lt numofplanets i) var r Math.sqrt(Math.pow(blackhole.x planet i .x, 2) Math.pow(blackhole.y planet i .y, 2)) planet i .acclx (blackhole.mass(blackhole.x planet i .x)) Math.pow(r, 3) planet i .accly (blackhole.mass (blackhole.y planet i .y)) Math.pow(r, 3) planet i .acclx (blackhole.x planet i .x) 60000 without force implementation in which planets get sucked inside the blackhole planet i .accly (blackhole.y planet i .y) 60000 without force implementation in which planets get sucked inside the blackhole) planet i .speedy planet i .accly planet i .x planet i .speedx planet i .y planet i .speedy i am trying to create gravity simulation model for a game in JavaScript.i need planets to move around a black hole in elliptical orbits. first i calculate acceleration and then add it to velocity and according to that i calculate the next position of planet. i first tried with just calculating distance vector between planets and black hole but in that scenario planets directly gets sucked inside the black hole and i need them to move in elliptical orbits. i tried calculating acceleration due to gravity but i think formula is wrong so can you correct it or provide some other implementation. |
6 | Why does this whirlpool simulation not work? I am trying to create a simple whirlpool simulation, where particles are constantly compelled to move towards a point in a whirlpool like fashion. To do this I do the following (in sudo code) variable speed 1.0 This can vary to speed things up Rotate by (70 speed) degrees Move Forward (4 speed) Steps Point Towards center And this works quite nicely, however as the particles get nearer to the center it breaks down causing there to be an area where they just circle around never getting closer to the center. The larger the speed variable is the larger the radius is that they begin to not move closer to the center. If one decreases the rotate by to a value of like 50 degrees the anomaly is much smaller, however the points rotate around the center many less times. Why is this happening? How can I fix this? I am open to completely changing the method I use even if it means physics, however polar coordinates will not work because of the way the center moves among other simulation reasons. |
6 | Rotate a rigid body not around its centre of mass I have a rigid body (a boat) whose centre of mass is towards the front of the object. However, this makes the rotation look strange as the rudder that is turning the object is at the back of the boat so the rotation would be around that point. How can I rotate the object from the a separate point (using forces) without changing the centre of mass? Applying a force at a location still causes the object to rotate around the centre. In real life, you need to pin down the point that you want to rotate around, forcing the object to rotate around that point. This would suggest using constraints but I can't figure out how that would work. You sort of need the rotation point to act as a hinge, but when I apply a suitable constraint, but that would just block the rotation rather than convert it into a rotation around the new point. I want to resolve this using physics driven operations in Unreal Engine 4. I don't want to move the Centre of Mass, admittedly for not a particularly good reason, but this still feels like a valid question even if that was an option what if you want to rotate around two different points. |
6 | Voxel blocks world physic I'm making a game like Minecraft. I have a world made of blocks and I'm trying to implement a basic physic system that applies gravity and checks entities colliding with the blocks of the world. I tried using Bresenham's algorithm, on player move, to get all blocks between, and then get the first solid and set the player on colliding position. That works well if the player is a point, but if it's a complex AABB and the block too, it becomes difficult. Is there a simple way to make physic in a voxel world like Minecraft? |
6 | How to search through large numbers of discrete objects that interact with each other, like Minecraft blocks? Imagine you had a world like Minecraft, but wanted to bake in some sort of physics (okay, I was playing minetest actually). For example, blocks under too much pressure might break, limiting how many blocks can be stacked on top of one another. I see one approach to this Systematically check each block. See if there is a block on top of that, a block on top of that, ect. Then, determine the pressure on the block that you just started with. Do this for each and every block. I also imagine you could somehow check each block, then have it modify the properties of the blocks around it. If all force was from top to bottom, you could just start at the top. But if you want to have a "net force" (so unsupported blocks accelerate) I have no idea how this could be implemented. For instance, three blocks are floating in mid air. How can I solve this class of problem? |
6 | Detect collision point I'm writing a 3D rigid body physics engine, I am using OpenGl for simulation. Only convex objects are considered. My question involves how to detect the point of collision, so that when I apply a response force, I can also calculate torque. I have used SAT algorithm to detect collision according to this reference, Everything seems to be work fine , But as i get SAT only gives for objects are they colliding? as well as by how much?, it does NOT give you a reference point at which to apply the response force (and thus calculate torque). I have looked at Resource 1 Resource 2 Resource 1 None of them seems to be an answer |
6 | Uncover Physics Object to Pick it Up I want to be able to have physics objects semi buried in leaves, dirt, or whatever and be able to have the player click on the area a couple times to uncover them, and he can't pick it up until he has uncovered it. (He picks it up also by LMB.) How can I achieve this? I am using blueprints. Can anyone show me how? |
6 | Best physics engine for OpenGL ES (different implementations)? Can you recommend a good physics engine which is easily portable between WebGL and other OpenGL ES implementations like in Android and iPhone? I don't want a game engine. Only the physics part. |
6 | Integration of gravitational interaction I don't know if this question get her place in physics.stackoverflow forum. I prefer post here, with code etc. So, I want simulate 2D movements (no rotation) of an asteroid in space affected by a planet's gravity, the problem is how integrate that ? Any better integration for performance ? Here is the code in C struct vec2 float x float y struct body double mass kg struct vec2 prev pos for semi implicit euler method struct vec2 pos position struct vec2 v velocity void move asteroid(float dt) semi implicit euler integration 1 moving the object asteroid.pos.x asteroid.v.x dt asteroid.pos.y asteroid.v.y dt START float x planet.pos.x asteroid.pos.x float y planet.pos.y asteroid.pos.y float d x x y y distance 2 between asteroid and center of planet acceleration float ah G ((planet.mass asteroid.mass) d) gravity get components of gravity float rad atan2(y, x) float ax ah cos(rad) float ay ah sin(rad) semi implicit euler integration 2 update velocity asteroid.v.x ax dt asteroid.v.y ay dt this is for 'fun' and sadly my knowledge is quite not good, I try to find with my vocabulary (not native english), if you have directions, ideas for better implementation (like study RK4 for correctness etc), it's welcome |
6 | How can I approximate walking physics via simpler sliding physics? I am modeling walking insects. I implement them as cuboids and use forces (including friction and drag), to control motion. However, the movement characteristics of this 'sliding box' physics don't match those due to a legged creature. For example, legged creatures near instantly accelerate to their top speed whereas applying a force to a box takes time to accelerate it. The applied force can be increased along with the counteracting drag, giving much quicker acceleration (via force) to a max speed (via drag). However, this also means the force that creatures can exert when pushing on other objects is increased. Does anyone know of any techniques using a physics engine to cheaply model walking creatures? |
6 | How is 'mass' handled in video games? Mass is one of the basic scalar quantities, which is required in most rigid body physics calculations. In a game, does every moving object have mass defined in the code, or is it allotted by the rendered objects size? Size should not be the only solution, though, since density also comes into play. For example how does the physics engine handle mass in the Frostbite engine used in "Battlefield 3"? |
6 | Numerical differentiation to calculate size of circular buffer I'm using Allegro 5 to create a software generated "motion blur" effect for my 2D sprites. I basically just have a boost circular buffer of some length which holds "snapshots" of the sprite going back in time. Each render cycle a new "snapshot" of the main sprite is pushed onto the front of the buffer, and the last is popped off the back. The "snapshots" are then rendered with alpha values scaled by how old far back in the buffer they are. To save on CPU power I'd like to have the circular buffer dynamically resized so that the length of the trail is proportional to the object's velocity, i.e. don't store and push back lots of snapshots for trail sprites that won't be needed anyway because the object is moving too slowly. The inputs I have to the data structure that holds the main sprite and its associated effect buffer are just the dx and dy values of how much its position vector changed since the last update cycle of the game logic. So I'm looking for a suggestion for an algorithm that can use that to increment decrement some kind of unsigned counter that can be used to resize the buffer proportional to velocity. |
6 | Detecting overlap with Phaser P2 physics In a 2D platformer, I'd like to implement a ladder. I have collision working between the player and ground tiles. Now I would like to be able to detect when the player walks through a ladder tile (which can be one of three tile indices). When the player is overlapping a ladder and up is being pressed, the climbing state would be set. Ideally, I'd like to get a callback when this happens. It seems that the overlap method from Arcade physics is not available in P2. What is there instead to implement overlap detection? |
6 | Why are my objects becoming permanently stuck to walls using Box2D? I setup a simple simulation environment something like billiards. There are four circle balls (dynamic) and four box walls (static). Simulation works... except one thing. Sometimes when a ball rest against a wall, it sticks to the wall eternally. The other balls hits the stuck ball so many times, but the ball never wants to separated with the wall. The only situation where the ball will become unstuck from the wall is another if another ball is rests against the same wall such that it hits the already stuck ball. Why does this situation occur? How can I avoid it? |
6 | Bouncy Ball stops without enough force I am building a 3D Pong clone and want to implement a frictionless bouncing ball. These are the steps i took Create a box in which the ball can bounce, consisting of standard cubic objects. Create a ball using a spherical object Add a Rigidbody to said ball (Mass 1, Drag 0, A.Drag 0, no Gravity) Add a bouncy Physics Material to the balls Sphere Collider (D.Friction 0, S.Friction 0, Bounciness 1, Fraction Combine min, Bounce Combine max) Add a script to the ball that adds force to the ball on start Script Snippet void Start() this.getComponent lt RigidBody gt ().addForce(0, 0, 100) When i play the scene, the ball will fly towards the wall and then stop. If i change the added force to (0,0,101) it works as intended. If i lower the mass of the ball and use the old force (0,0,100) it also works. But it will always stop at the wall, if the added force is lt mass 100. What am i missing? |
6 | How can I implement fixed joints in a 2D physics system? I'm developing a simple, 2D physics system to complement an entity component game object framework. So far, I have implemented some basic, tutorial level physics. An entity that is affected by physics must have two components Transform (translation, rotation, scale may have parent transform) Rigidbody (mass, list of forces) The physics engine currently uses Verlet integration to move entities that is, velocity is derived from the current and previous positions of an entity, and is not explicitly stated anywhere. I would now like to start implementing some joints, starting with the basics and perhaps expanding as I grow more familiar with the concepts. The first joint I attempted to implement was extremely simple the fixed joint, whereby two entities are 'fixed' together and their transforms may not change relative to each other. My approach was to make one entity an immovable child of the other that is, to set the transform of A as a local transform relative to B and disable movement of A by passing all accumulated forces of the rigidbody of A to the parent, B. Already this seems hackish and inflexible and has issues with gravity (B ends up with two gravity forces acting on it) I'm clearly heading in the wrong direction. I have searched for some literature on the subject but have only found either very basic tutorials that only cover what I've already done, or articles with advanced mathematical formulae that are difficult to follow or relate to simulation in any meaningful way. This leads to two questions How are fixed joints normally implemented? Are there any good 2D physics simulation tutorials aimed at those without a degree in physics or mathematics? |
6 | Can I change shape of a rigid body after it created in Bullet3D? I'm beginning Bullet3D. Can I change collision shape of a rigid body after it created? A rigid body accepts a collision shape when it's creating, but it's hard to find options changes the collision shape of an instance. |
6 | Pseudo magnet implementation with chipmunk How should I go about implementing "natural" magnet on a certain body in chipmunk space? Context is of simple bodies lying in the space (think chessboard). When one of the figures is activated as a magnet others should start moving towards it. Currently I'm applying force (cpBodyApplyForce)to the other figures with vector calculated towards the activated figure. However this doesn't really feel "natural". Are there any known algorithms for imitating magnets? |
6 | Box2D Making it Determinsitic? From articles on the web, I found that floating point math generally has accuracy of at least 6 digits. With this in mind, is it possible to make Box2D which uses floats fully deterministic through the use of heavy rounding (i.e. 1st or 2nd decimal place)? |
6 | How to connect a UPhysicsConstraintComponent of an AActor to an FKSphylElem (capsule body) of a ragdoll? I'm trying to connect an Actor's UPhysicsConstraintComponent to a capsule body of a ragdoll. The reason I do it this way, instead of just using sockets on the constraint, is bodies may have offsets from bones, and than connected things things would look incorrect. I'd like to connect to the physics bodyFKSphylElem instead of the bone socket. The Physics Asset has a TArray lt UPhysicsConstraintTemplate gt called ConstraintSetup, which I am adding my quot Actor constraint quot to. It also has a TArray lt USkeletalBodySetup gt . These USkeletalBodySetups contain the geometries I'd like to connect to,in this case capsules as FKSphylElems. I wrote some code to give my idea a test. I am setting up bone and component names for the new constraint, but it does not connect objects, although the new UPhysicsConstraintTemplates and FConstraintInstances are added to the Phats ConstraintSetup (checked in the debugger). void UBPLibrary ConnectConstraintToSkeletalMeshActorPhysicsAsset( UPhysicsConstraintComponent Constraint, USkeletalMeshComponent Mesh, FName BoneName) if (!IsValid(Mesh) !IsValid(Constraint))return UPhysicsAsset Phat Mesh gt PhysicsAssetOverride if (!IsValid(Phat))return UPhysicsConstraintTemplate constraintTemplate NewObject lt UPhysicsConstraintTemplate gt () FConstraintInstance ConstraintInstance amp Constraint gt ConstraintInstance ConstraintInstance gt ConstraintBone1 BoneName ConstraintInstance gt ConstraintBone2 FName(Constraint gt GetName()) constraintTemplate gt DefaultInstance ConstraintInstance if (!IsValid(constraintTemplate))return Phat gt ConstraintSetup.Add(constraintTemplate) apply changes to the ragdoll UWorld world GetWorld(Constraint) FPhysScene PhysScene PhysX world gt GetPhysicsScene() Mesh gt TermArticulated() Mesh gt InitArticulated(PhysScene PhysX) |
6 | Bullet Physics Difference between Motion State and World Transform In Bullet Physics, when I create a new btRigidBody, one of the parameters passed to the constructor is the btMotionState, which defines the initial pose of the body. However, if I then later want to change the pose of the body manually (for example, if it is a kinematic body), how can I do this? What I have tried so far, is to use the body's setWorldTransform() function. For example glm mat4 pose pose 3 0 0.5 pose 3 1 2.0 pose 3 2 1.0 btTransform new transform new transform.setFromOpenGLMatrix((float ) amp pose 0 ) my body gt setWorldTransform(new transform) However, when I then try to read the pose of the object again btTransform trans my body gt getWorldTransform() std cout lt lt "Y " lt lt trans.getOrigin().getY() lt lt std endl It returns the value set in the body's constructor, not the value set in setWorldTransform(). Please can somebody explain the different between the motion state, and the world transform, and how I should go about manually updating the pose of a kinematic object? |
6 | Lunar lander How to calc acceleration in each step I'm trying to make a lunar lander simulator. I'm going to use a simple Euler integration. AFAIK all I've to calculate is the acceleration in each step, and then I should be able to update velocity and position. I'm following this page http www.braeunig.us apollo LM descent.htm There's a paragraph I don't really understand Although most operations are self explanatory, a brief description of acceleration is warranted. Acceleration is broken down into vertical and horizontal components, where the vertical component is normal to the Moon's surface. The instantaneous vertical and horizontal accelerations of a moving body in reference to this surface are Av Vh 2 r and Ah VhVv r. To this we add the accelerations resulting from gravity and thrust. Gravity, of course, acts vertically downward. The vertical and horizontal components of thrust are a function of the pitch angle. The author is making a much more realistic simulation here and because of that he is not assuming the Moon is flat. He comes up with two initial values for each acceleration component Av Vh 2 r Ah VhVv r 1 Seems that Av is the centripetal acceleration, but where does the Ah come from? 2 Are those initial values really needed? In my game the Moon is going to be flat. I thought taking into account thrust mass and gravity would suffice. Thanks in advance. |
6 | Does friction only apply in opposite direction of motion? Let's say an object is sliding on a slope and is the object has a velocity of (0,0,5). The friction would be acting in the opposite direction of motiong, being (0,0, 1). However, gravity is also affecting the object on the slope. The gravity is doing an impulse of ( 1, 1,0) every frame in the direction of the slope tangent. Should the object also experience friction in the direction of (1,1,0)? Or would it only experience friction in the direction of (0,0, 1)? I find the notion that friction always opposes the direction of motion strange, because this means that when an object is sliding downwards slightly on a slope, but not much, due to friction acting in opposite direction of gravity, when you add an impulse in a perpendicular direction, suddenly the object will be sliding downwards much more because friction is no longer resisting gravity. Is that correct? |
6 | Transfering an inertia tensor from local coordinates to another one If we have an inertia tensor in local coordinates with a basis matrix B and we want to transform it to other local coordinates with basis matrix A, is it right to do the following A inv(B) Inertia Tensor Where my idea is to shift the inertia tensor to world coordinates by multiplying it by the inverse of B, then from the world coordinates to the A coordinates by multiplying it with A matrix? |
6 | How do you properly implement level boundaries in a physics room? I have an issue with creating a proper boundary in GameMaker Studio when using a physics enabled room. My room has a gravity of 0, as it is in Space. My player object has the default values, but a friction of 10 with a box shaped collision shape. I also use View0 on a 1280x720 room with a 1280x720 view. That is to be able to do screen shakes and other neat effects. I really struggle with containing my player object properly to the room. When I use a collision with view0 boundary and add phy position x phy position previousx phy position y phy position previousy then my ship would get stuck at the screen borders very frequently. I also tried adding some sprites that block the player off the room and created a sprite, 1280x720 and spawned them at the borders. I gave my player empty events for them and set their density to 0, making them static. However, this resulted in the same problem, I got stuck in them. I need a smooth solution for this, obviously, to have a fun experience. I have this problem quite for a while, so please help me understanding how to do this properly. |
6 | Physics for space game I am making a space game where you fly a ship. I am trying to work out the physics for such a game and so far came up with var thrust between 1 amp 100 how much the engines are pushing var mass the mass of the spaceship var speed the speed at which the spaceship is moving Now big ships will have more mass to therefore take longer to speed up and longer to slow down once the thrust is off. Big ships will be slow because of the mass. Small ships will speed up faster and slow down faster but also go faster. How will I implement this into a game? I can do the keyevents, if up is pressed for 5 frames for example will I make the thrust raise to by 10 each frame(example) and then increase the speed of the ship based on some formula of the mass amp thrust? This is the game Only UI and menus made but wan to get an idea of my physics before I implement the movement http www.taffatech.com DarkOrbit.html |
6 | Deformable meshes based on torsional spring I am trying to learn physics based animation thanks to the book "Foundation of Physically Based Modelling and Animation". They introduce the mass spring model for deformable meshes. Although making each pair of vertices a mass spring system would give good results, it would be too heavy to compute. So, the authors introduce another technique between each pair of adjacent triangles, the evolution of the angle is based on a torsional spring model. I don't know if you can read it on the Google preview. It's on page 161 https books.google.fr books?id vaqdDQAAQBAJ amp printsec frontcover amp dq torsional spring foundation of physics based animation amp hl fr amp sa X amp ved 0ahUKEwj oPTkvobcAhVDtBQKHfj2AaYQ6AEIKzAA v onepage amp q amp f false I struggle to understand this model. For instance, let's imagine we have two adjacent triangles ABC and BCD . Let's theta be the angle between both triangles. The torque is tau k( theta theta 0) . We want to compute the equivalent forces f A , f B , f C , f D , and torques tau A , tau B , tau C , tau D relatively to B . They state that all sums must be equal to zero f A f B f C f D 0 tau A tau B tau C tau D 0 I don't understand why. Can you give me some help ? Thanks. |
6 | Solving constraints joints in 1D For n points moving in 1 dimension. Position and velocity are known for each point. Each frame a basic integration is done for each point velocity forces timestep forces 0 position velocity timestep Each point (except for the first one) is attached to the point following it (e.g to its right) with a distance joint of the form point2 point1 lt distance amp amp point2 point1 gt 0 Which means that the points shouldn't be further appart than distance or closer than 0. Energy should be conserved, i.e a point should be able to push pull another. I tried to solve every constraints with impulses, but it messes with velocities. (at least the way I did it..) Searching around, I found a lot of resources but I'm unfortunately not able to understand all of it. If anyone can give me a general idea starting point ? |
6 | Best physics engine for OpenGL ES (different implementations)? Can you recommend a good physics engine which is easily portable between WebGL and other OpenGL ES implementations like in Android and iPhone? I don't want a game engine. Only the physics part. |
6 | Find Initial Velocity for Parabolic Arc with Fixed Angle that Crosses Target Position In my game I want skeletons to occasionally lob bones at the player. The player can be anywhere in relation to the skeleton (above or below, to the left or right), and I want the skeletons to throw a bone such that it lands on the player (or its parabolic arc intercepts them while rising, if the player is above the skeleton). Given an arbitrary starting position, an arbitrary target point, and an arbitrary launch angle, how can I calculate the initial velocity of a ballistic projectile (assuming no air resistance) such that its parabolic trajectory intercepts the target point? I know there are a number of similar questions on this site, but none of them appear to have this particular set of requirements Calculating initial velocities given trajectory parabola requires a known fixed apex height. Calculating velocity needed to hit target in parabolic arc and Throw object towards predefined place? assume a known fixed travel time. I want to have a fixed launch angle, initial position, and final position, and from those determine the initial velocity. The Wikipedia article Trajectory of a projectile comes close, but I have no idea how to solve that for velocity. Reference In computer coordinates, the Y axis is inverted from Cartesian coordinates. The accepted formula operates independently of this, but it's unintuitive to deal with. This means that gravity will be a positive number, while being above the projectile will result in a negative displacement. This also means that the fixed angle you choose will be the negative of what the habitual version would suggest. As a final note, I adjusted for the absolute value of Vx by performing this manipulation before calculating Vy if sign(x velocity) ! sign(delta vector.x) x velocity 1 x velocity var y velocity x velocity tan(angle) Full pseudocode reference static func get velocity of arc intercept(initial position, target position, angle) var delta vector target position initial position var x velocity sqrt((gravity delta vector.x delta vector.x) (2 (delta vector.y (tan(angle) delta vector.x)))) Adjust for lost sign. if sign(x velocity) ! sign(delta vector.x) x velocity 1 x velocity var y velocity x velocity tan(angle) return Vector2(x velocity, y velocity) |
6 | collisions How to handle contact constraints for a rigidbody constrained to a line segment I'm trying to come up with a strategy to handle a situation in 2D, where a rigidbody moves along a straight line segment, and can collide with other similar bodies and also static tiles. A naive approach was to handle collisions by projecting the displacement vectors onto the line segment (worked ok for aabb), and then at the end snap the position of the rigidbody back to the line, which had lots of conflicts. I'm trying to implement impulse based physics, so far only handling contacts, and unsure how to both constrain the rigidbody to a line segment and handle contacts at the same time. Or is it better to do in two separate phases. It's probably easier to allow some displacement from the line and then gradually move the body back to it. Any suggestions? |
6 | Simple collision resolution in a platformer game I want to make a 2d platformer with moving, jumping and wall sliding. How can I make a simple pleasant collision resolution system that works for the following rectangles. Player is red, platform is black, I want to detect if the player is sliding a wall, or hitting the ground, or doing both ( as in third example). Also take the appropriate response. Also I have no idea what I am talking about so a little context might help. These resources helped me How to resolve collision 2D AABBs and resolving multiple collisions How to detect overlap between aabb vs aabb http noonat.github.io intersect |
6 | How can I predict player to projectile collisions in Box2D? I'm making a real time shooting game with Box2D as the physics engine. The gameplay is mostly about trajectory, like Angry Birds. I want to make a slow motion effect and move camera to the player when he's killed, but the effect should start when the stone is still in the air, before the collision actually happens. The magnitude of damage is only calculated at collision, based on impulse. Because it's a real time game, the player must be able to move their character's physics body without lag. How can I predict their death? Is it even possible? I could raycast, but what if another object moves to block its path? |
6 | Correct order of tasks in each frame for a Physics simulation I'm playing a bit around with 2D physics. I created now some physic blocks which should collide with each other. This works fine "mostly" but sometimes one of the blocks does not react to a collision and i think that's because of my order of tasks done in each frame. At the moment it looks something like this function GameFrame() foreach physicObject do AddVelocityToPosition() DoCollisionStuff() Only for this object not to forget! AddGravitationToVelocity() end RedrawScene() Is this the correct order of tasks in each frame? |
6 | Costs for developing an Iphone physics game? I recently made a game demo inspired by a wooden board game where you drop the ball trying to make a score, is fully playable so take a look (Works best on firefox) https dl.dropbox.com u 62131673 LuckyBall Chrome index.html I want to build this game for the Iphone's App Store, add accelerometer features, menus, unlockable levels, best scores, etc. I'm a graphic designer so I prefer to keep working on the presentation (graphics, assets, sound, music) and leave the rest to the programmer. I want to know how much this game would cost for a programmer to be developed, so I can make a video at kickstarter.com and sell the idea, with luck this game will see the light. I don't want to open a debate on the subject, I just need advice on the costs so I can hire someone. |
6 | 3D Physics in Marmalade SDK I am trying to make an 3d game in Marmalade. I am completely new to Marmalade. How to add 3d physics, gravity, dynamic object, sensors, colliders in Marmalade. I was going through the API and did not find anything. Can you guys let me know how to accomplish these things |
6 | What is a collision shape? I am a business developer who is new to game programming. In learning Stencyl, I see that there are things called collision shapes associated with tiles. This seems to be a standard term in game programming. What is a collision shape? |
6 | Integration of gravitational interaction I don't know if this question get her place in physics.stackoverflow forum. I prefer post here, with code etc. So, I want simulate 2D movements (no rotation) of an asteroid in space affected by a planet's gravity, the problem is how integrate that ? Any better integration for performance ? Here is the code in C struct vec2 float x float y struct body double mass kg struct vec2 prev pos for semi implicit euler method struct vec2 pos position struct vec2 v velocity void move asteroid(float dt) semi implicit euler integration 1 moving the object asteroid.pos.x asteroid.v.x dt asteroid.pos.y asteroid.v.y dt START float x planet.pos.x asteroid.pos.x float y planet.pos.y asteroid.pos.y float d x x y y distance 2 between asteroid and center of planet acceleration float ah G ((planet.mass asteroid.mass) d) gravity get components of gravity float rad atan2(y, x) float ax ah cos(rad) float ay ah sin(rad) semi implicit euler integration 2 update velocity asteroid.v.x ax dt asteroid.v.y ay dt this is for 'fun' and sadly my knowledge is quite not good, I try to find with my vocabulary (not native english), if you have directions, ideas for better implementation (like study RK4 for correctness etc), it's welcome |
6 | How does server correct late input Imagine the following scene The height one player can reach on jumping depends on how much time the button for jumping is pressed. When the player jumps, the input is sent to the server and physics are updated. Now, imagine that for some reason, one input packet is lost or due to lag it begins to arrive late. From the point of view of server, the player is not jumping anymore, and its character will start its fall. Every other client will receive this information and let the character fall. Then, a new packet arrives that corrects this problem. From the perspective of the player, the character is still jumping. Maybe, thanks to this extra input the character can reach a higher slope. But from the point of view of the server and rest of clients, it wont make it. This could happen, but online games that i have played (except for long jumps and high lag) it doesnt happen. My question then is How does the server handle this situation? It cannot wait forever for input, it must update physics and acknowledge other clients on what's going on. |
6 | How do I set angular velocity torque so that it's pointing to velocity direction? Right now, when I spawn a shootable object, it goes like this Because I just set it's angle to this float aimAngle (float) Math.atan2(velocity.y, velocity.x) bullet.setBodyAngle(aimAngle) I want it to be like this I think I should use angular velocity or torque, but I have no idea how. I can't just set it's angle like in previous code every frame, because it makes physics collisions glitch. |
6 | Physics engine recommendation which can simulate pool game correctly? I'm making a pool game like game. This game requires correct (or very accurate) reflective bounces. I tried Box2D and Bullet Physics, but they both have this problem. If there is a wall on top of this image, red line is expected course of a real ball in a pool game. But the engines often shows green line course. Especially, This happens after a slowly moving ball hits the wall. Sometimes a rapidly moving ball get slower suddenly. I'm finding a physics engine which can simulate pool game accurately as much as possible without these problems. Can I get some recommendations? Now I'm digging Newton Game Dynamics, but I am not sure the engine will show what I want. I'm considering the PhysX engine as a next trial, and have to make my own if nothing works. But it's obvious it'll take very long time, so I wish I won't do that. I'll be very appreciated if you save my time. And of course, solution with Box2D Bullet Physics are also welcomed. I am working with C C Objective C on iOS. I attach my configuration with Box2D. Walls static box shape linear angular damping 0.1 restitution 1.0 friction 100 density 10 bullet false fixed rotation false inertial scale 1.0 Balls dynamic sphere shape linear angular damping 0.1 restitution 1.0 friction 100 density 20 bullet true fixed rotation false inertial scale 1.0 |
6 | AS3 Flashdevelop Controlling a 2D character to move around a planet with gravity With a little help I have managed to create a 2D planet with working gravity that constantly pulls a character towards its center. The only problem now is that I am completely stumped on how to make it so the user is able to make this character traverse the planet as one would expect rather than the simple up down left right we are used to in natural platformers. It should be noted the planet being traversed will have platforms layers to jump and fall onto, so the moving and jumping should be in relation to the center of the planet, where the center of the planet acts as "down" would in a traditional platformer (which is why I seem to think I need a complicated way to create this kind of natural movement). I had the idea of recalculating a new left and right direction to move in every time position is changed but the logic I have to work out to achieve this is beyond my knowledge. Is this the only way to go or should I try tackling the problem differently? I hope not because I don't think I'd be able to achieve this otherwise. This is my current code showing how the gravity works, with a simple placeholder for movement that just allows the character to move up down left right on the screen public function moveChar(event Event) void if (leftPressed) character.x mainSpeed if (rightPressed) character.x mainSpeed if (upPressed) character.y mainSpeed if (downPressed) character.y mainSpeed public function gravity() void tan2(planet.y player.y, planet.x player.x) angle Math.atan2((planet1.y 2245) (character.y 5), (planet1.x 2245) (character.x 5)) gravityX Math.cos(angle) gravitationalAcceleration gravityY Math.sin(angle) gravitationalAcceleration distance Math2.Pythagoras(planet1.x 50, planet1.y 50, character1.x 5, character1.y 5) distance Math.sqrt((yDistance yDistance) (xDistance xDistance)) Calculate the distance between the character and the planet in terms of x and y coordinate xDistance (character.x 5) (planet1.x 2245) 320 to 50 yDistance (character.y 5) (planet1.y 2245) 320 to 50 Make sure this distance is a positive value if (xDistance lt 0) xDistance xDistance if (yDistance lt 0) yDistance yDistance Update the current velocity before new velocity is calculated initialXVelocity finalXVelocity initialYVelocity finalYVelocity Send the character into the correct direction character.x gravityX character.y gravityY Basic collision detection of the surface, basic stop of gravity if (distance lt planet1Radius) trace("hit!") if (planet1.x 2180 lt character.x 5) 320 to 50 character.x gravityX 1.025 else character.x gravityX 1.025 if (planet1.y 2180 lt character.y 5) 320 to 50 character.y gravityY 1.025 else character.y gravityY 1.025 else trace(" no hit!") edit1 I now have this code thanks to DMGregory var characterPosition Point new Point() var planetPosition Point new Point() characterPosition.x character.x characterPosition.y character.y planetPosition.x planet1.x planetPosition.y planet1.y var localUp normalize(characterPosition planetPosition) var localRight new vector2( localUp.y, localUp.x) However, I have trouble understanding the syntax I should be using here, and also for when I need to move the character. Should it look something like this if (rightPressed) character.x localRight if (leftPressed) character.x localLeft |
6 | Inelastic ball collision I'm trying to implement basic inelastic ball collision. The example on the link above is for one dimension. It explains that it's the same for 2D but where the velocities are the components in the direction of the normal in the point of collision. I have tried calculating these components by projecting on the normal vector, and then calculating the new velocities. But then I got stuck. How do I get the new velocity vectors? My attempt below does not produce any good result. Can you help me out? (The two balls are intersecting in one common point when I run the code below) UPDATE I have edited the code now so that the two last lines is more correct I think. The thing is I have to combine the new velocity vector component with the old velocity vector component that was first subtracted in the projection operation, to get the complete new velocity vector. Now the animation looks a lot better. I still get occasional ball merging and popping but that could be some other part of my code thats wrong. var m this.Mass other.Mass normal in the point of collision var n (this.Position other.Position).Normalized velocity component perpendicular to the tangent in the point of collision for ball A var ua (float)(this.Velocity.Magnitude Math.Cos(this.Velocity.Angle(n))) velocity component perpendicular to the tangent in the point of collision for ball B var ub (float)(other.Velocity.Magnitude Math.Cos(other.Velocity.Angle(n))) the new velocity for ball A var va (0.9f other.Mass (ub ua) this.Mass ua other.Mass ub) m the new velocity for ball B var vb (0.9f this.Mass (ua ub) this.Mass ua other.Mass ub) m the new velocity vector for ball A this.Velocity n (ua va) the new velocity vector for ball B other.Velocity n (ub vb) |
6 | How to resolve multiple simultaneous ball collisions in a pool game? I'm trying to simulate a break shot in billiards (1 ball hits a pyramid of 15 balls). The formula for 2D ball collision works correctly in my game. But when it is applied to the break shot, the result doesn't look realistic. (Only the 2 balls in the corners of the pyramid move, but the rest stays in place). The problem is that because 15 balls are touching each other, there is an "infinite" number of simultaneous collisions following the first one. What algorithm or formula can be used to resolve that? |
6 | How to apply force to rigid bodys at a specific point? I am trying to write a physics engine from scratch to get a better understanding of them. It worked pretty good so far, but there is one thing, i can't get my head around If i have a rigid body ( for example circles or rectangles) and i am applying a force F at a point P to it. Now my problem is to figure out, how this force will affect translation speed and rotation speed of the rigid body. So far i have figured out, that it might has to do with the center of mass and the moment of inertia. |
6 | How can I fix my velocity damping to work with any delta frame time? I am decreasing my velocity by 50 every second using a guide I found online. I am using the code here and it gives the right result but only for very small values for dt float dt, velocity, position dt 0.002f velocity 1.0f position 0.0f for (float t 0.0f t lt 1.0f t dt) position velocity dt velocity lerp(velocity, 0.0f, 1.0f std pow(0.5f, dt)) printf("dt f, p f, v f n", dt, position, velocity) dt 0.09f velocity 1.0f position 0.0f for (float t 0.0f t lt 1.0f t dt) position velocity dt velocity lerp(velocity, 0.0f, 1.0f std pow(0.5f, dt)) printf("dt f, p f, v f n", dt, position, velocity) return 0 But I am getting roughly the right velocity BUT two different final positions back when I use two different delta times (not due to floating point issues) dt 0.002000, p 0.722848, v 0.499308 dt 0.090000, p 0.784219, v 0.473029 How can I fix this difference inside of my update loop? How do I account for the extra acceleration between timesteps? |
6 | Detect collision point I'm writing a 3D rigid body physics engine, I am using OpenGl for simulation. Only convex objects are considered. My question involves how to detect the point of collision, so that when I apply a response force, I can also calculate torque. I have used SAT algorithm to detect collision according to this reference, Everything seems to be work fine , But as i get SAT only gives for objects are they colliding? as well as by how much?, it does NOT give you a reference point at which to apply the response force (and thus calculate torque). I have looked at Resource 1 Resource 2 Resource 1 None of them seems to be an answer |
6 | How to implement a configurable spring force to SpringJoint2D like SpringJoint does? I'm working in unity 5.3.4f1. Looking at the SpringJoint2D class I can't seem to find a similar "spring force" as in spring in SpringJoint. Is there any other way to make a spring stronger in SpringJoint2D? If not, the only option I see is to inherit the Joint2D parent class and build my own spring joint 2D. |
6 | Algorithm to propagate internal Physics force in a structure of building Scenario A floating structure composes of many nodes (or in more visual meaning a cubic block). Every node is snapped to the same 3D grid. (similar to a minecraft castle) There are external forces apply to each node at different values. For example, node A receives force Vec3(1,0,0) at time 1s 3s, node B receives force Vec3(0,1,0) at time 2s 4s. Most external forces apply to center of mass of node. Every pair of adjacent nodes (6 neighbors) is tied together by a "joint" i.e. glue. Each joint can received some (but limited) pulling pushing force torque. Question How to calculate approximate force of each and every joints? I want to use them to break object apart create some spark graphics. Maximum flow problem is fast, but too limit for this case. Although it is quite efficient to propagate force like fluid in pipe system, it don't support Torque and many sources sinks. https en.wikipedia.org wiki Maximum flow problem Networks of Torque Propagation requires a solid ground, so it can't be used for this problem. http www.cs.brandeis.edu pablo thesis html node29.html Bullet Physics Engine I tried to use its constraint, but for very high amount of nodes (400), they are not stable, i.e. become divergent amp explode. My poor approach I initialized all force between joint Vec3(0,0,0), and then use Newton Rules (F ma amp T Ixw) to propagate force gradually in each iteration. It always yields perfect result but take too much time (10 ms), so it is unusable. Note that the algorithm can provide non optimal solution and can have some limitation (e.g. no torque). Performance is important (500 nodes within 1 2 ms, C ). |
6 | What are the parameters for btHingeConstraint setLimit? What does each parameter in btHingeConstraint setLimit do to the hinge constraint? void btHingeConstraint setLimit ( btScalar low, btScalar high, btScalar softness 0.9f, btScalar biasFactor 0.3f, btScalar relaxationFactor 1.0f ) |
6 | How do I set an object's speed to arrive in X seconds? I want to move an object to a point in the game world, I have the distance value which is far the player should move. I want to complete the movement in X seconds. I have tried many equations and formulas to no success. Speed Distance Time This one doesn't seem to give me the right result. Thing is the game is updated 60 times a second and the movement is affected by delta time. I'm pretty sure I am not taking the framerate in consideration. What am I doing wrong? Edit This is how I calculate the speed int dst 500 int time 2 in seconds float speed dst time Doing it this way is making the movement instant and the game object is not traveling the distance in 2 seconds. Every frame each game objects gets updated this way p.x dir.x speed deltaTime p.y dir.y speed deltaTime The dir vector holds the direction of movement which is calculated on mouse click Vector2 dir new Vector2(mouseX, mouseY).subtract(objectX, objectY).normalize() Delta time calculation long time System.nanoTime() float deltaTime (time lastTime) 1000000000.0f lastTime time Please note The game object stops upon arrival. |
6 | cocos2d syncing CCAnimation frames with Box2d Shape manipulations my cocos2d game currently has a ccsprite attached to a box2d body. during the game i apply different CCAnimations on my sprite, i would like to perform certain manipulations to the box2d body according to the frame currently displayed by the sprite (change rotation of the body, etc.) my current idea on implementing this is to subclass ccsprite and change the setDisplayFrame implementation but i thought somebody here probably did the same and already has a solution, so any suggestions on how to implement this? thanks! |
6 | Box2D Love2D (Lua) Assertion fail with polygon meshes When I try to create a triangle collider for my game it sometimes leads to an assertion fail. I use the physics engine that comes with love2d (Box2D). That's the error message that appears when the assertion fails love modules physics box2d Source Collision Shapes b2PolygonShape.cpp 85 b2Vec2 ComputeCentroid(const b2Vec2 , int32) Assertion area gt 1.19209289550781250000e 7F' failed. Here's an example of a triangle that doesn't cause the error (represented by a table with 3 points) 258,451 , 740,767 , 284,597 And this one leads to a crash 258,450 , 222,569 , 306,723 The bodies of both shapes lie at 0, 0 (upper left corner of the screen) Does anyone know a possible reason and or solution for the problem? Edit I'm not allowed to answer my question right now for some reason so I'll post the answer here before I've forgotten it In Box2D, the order of placement of vertices seems to play an important role, since I was able to avoid the crash with the "problematic" triangle in my example from my question just by placing the first vertex between the second and the third one. Maybe I'll repost the answer when I'm able to provide more information (and am also allowed to do so) |
6 | gamemaker getting a ball to bounce 90 degrees off of a 45 angle I am trying to get a circle to bounce off a 45 degree diamond shap using Gamemaker Studio. I would like the ball to bounce in straight lines so my directions would be 0, 90, 180, or 270 degrees, depending on which side of the diamond the collision takes place. Precise bouncing is giving me all sorts of results so I think I would have to do it in code. I tried saying if (direction 0 amp amp direction lt 90) direction 90 And doing this for all the angles, but this did not work. Has anyone encountered this before? |
6 | ways to make a physics engine Hey so i've been looking into real time physics engines, which led me to the crazyLaggoa multiphysics engine by thiaga costa, and brought up the question of What are some possible ways, ideas that have or have not already been done to make a real time physics engine? How about non real time? I know the Lagoa engine uses meshes and a crapload of particles... and then there's the rigid body way of going about things..... Also i'm only at 2d level in creating games right now so any 2d physics ideas would be great too! |
6 | How to throw b2body with various speed at fixed position? Above image is for ref to better representation. I have box2d object and i know start point amp end point position. Now i want to give any force or impulse such that b2body will first collide at end point BUT with different speed also should collide at that same end point. How should i achieve this? |
6 | How to calculate continuous motion with angular velocity in 2d I'm really new with physics. Maybe someone would be able to help me to solve the next problem I need to calculate position of an agent on the plane(2D) in next time step where time step is large(20 seconds) What I know about agent's motion Initial Position Direction(normalised vector) Velocity(linear function from time ) object always moves along it's direction Angular Velocity(linear function from time) Optional External force direction External force (linear function from time) Running discreet simulation with t 0 is not an option. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.