Advertisement Jump to content
  • Advertisement

adriansnetlis

Member
  • Content Count

    223
  • Joined

  • Last visited

Community Reputation

291 Neutral

About adriansnetlis

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. adriansnetlis

    [UE4] Rotation aligning issue

    OK! So I decided to store the Y rotation in a seperate vartiable. Each frame I reset the wheel's relative rotation and than adjust the camber. After that I rotate the wheel around it's local Y axis by the variable amount. The result is statisfying :)
  2. adriansnetlis

    [UE4] Rotation aligning issue

    Well, I know 2 of those articles already. I've solved most of those problems. Actually my problem now is correctly visualising car. And at this moment the visualisation problem is the camber angle. I can't find a good way to visualise camber angle that can change dynamically... And by visualise I mean applying calculated data to visual meshes of wheels.
  3. adriansnetlis

    Locking 2 turning objects - the inertia problem

    Proportionally to their moments of inertia.   Oh, wait... Is it 1.25 / (0.025 + 0.05) = 16.6666667? If so, than it seems pretty much beliveable. At this specific case the momentum is conserved, but it's also turning faster than 15. I think that I just got how it works. Thanks!:)
  4. adriansnetlis

    [UE4] Rotation aligning issue

    Thanks! I'll look into those!:)
  5. adriansnetlis

    Locking 2 turning objects - the inertia problem

      Why is that so obvious ?   This is not. Are these objects turning around their gravity center ? their geometry center ? What makes or had made them turn ? Any kept forces ? Are these objects in the void ? On a perfect ice maybe ? Or are they on a rough ground ? What about their surface ? And about their weight and the gravity in which they might be ?   What I want to say is that without a perfect and complete definition of your system, there will be no relevant answer to your question.   I already told that we assume no friction or such external forces and thus it's fully conserving angular velocities. Assume objects turning in void. So... L1 = 0.025 * 10 = 0.25 L2 = 0.05 * 20 = 1 L = L1 + L2 = 1.25 And now... How do I split this momentum between both?
  6. adriansnetlis

    [UE4] Rotation aligning issue

    https://answers.unrealengine.com/questions/478614/set-object-rotation-relative-to-other-object.html I have explained the problem in that article. Knowing the answer rates in UE4 answerhub I decided to ask here. How do I solve that problem? It should be easier with the functions aviable in UE4, but yet I have no idea where to start to make this... I hope that there is somebody who knows how to solve this, though!:D
  7. Firstly, let's assume that we have 2 perfectly identical objects. One of them is turning at 20 rad/s, but the other one - 10 rad/s. Now they get locked together. Let's assume no velocity loss during locking. What velocity will they each turn after being locked? It's pretty obvious that they'll be turning at 15 rad/s. Problem solved! However, now let's make them both be solid cylinders with identical shape, but one of them be twice denser than first one. One of them is 5 kg heavy, but other one is 10 kg heavy, as example. Both of them got radius of 0.1 metre. So inertia of the first one is calculated like so: I = (5 * 0.1^2) / 2 = 0.025 For the second one it's: I = (10 * 0.1^2) / 2 = 0.05 So the second one also got twice bigger inertia. Now let's assume the same case. First cylinder is turning at 20 rad/s and second one is turning at 10 rad/s. They get locked. And now I get lost. I know well that they're gone end up turning slower than 15 rad/s as there is more momentum at the slowest turning cylinder. However, I don't know how to calculate how fast will they turn. So what I ask for is the calculation for this specific problem.
  8. So let's say I have a rotation as 3 float values - one for each axis. And I have 3 direction vectors of the object(2 should be enaugh, though). My rotation system only allows to use local Euler angles for rotation, however, I need to rotate in world space. How do I convert world space rotation angles to Euler angles using directional vectors?
  9. adriansnetlis

    Fast Square Root For Distance Calculations?

    um... Welll... The integrate function calls one more function several times at one position. And if I wrote it all inside the code - it'd make the code a huge mess + I doubt it would be any faster. But you wanna tell that OOP + Python = slow?
  10. adriansnetlis

    Fast Square Root For Distance Calculations?

    Thanks for info! Well, yeah... Final project will be written in C++. I was just hoping to write the code for Blender Game Engine. In my case the map() won't work because my for loop looks near like this: for j in self.joints: o1 = j.object1 o2 = j.object2 j.integrate(o1, o2) # j is a class, j.object1 and j.object2 are classes, integrate(self, o1, o2) is a function inside j class class j: ...some stuff here... def integrate(o1, o2): distance = (o1.position - o2.position).magnitude ...more stuff here... This is how the code looks, more or less...
  11. adriansnetlis

    Fast Square Root For Distance Calculations?

    Well, it's working. I got a Python script that does mathematical calculations with use of vectors(but no matrices or any other similars). It does it all in loops. I write it in OOP. Somehow it seems that I got performance issues, but after checking my code several times I find it being clean and well-optimized. I read at some resources that loops in Python are incredibly slow. I just wanna get confirmation for this and, if possible, some ways to speed it up.
  12. adriansnetlis

    Fast Square Root For Distance Calculations?

    Hello! Thanks for answers. Well, I don't need to compare 2 distances so the squared distance won't work. It turns out that square root wasn't my problem. I have the vector length calculated in a for loop together with few more(but actually lighter) equations. I was surprised how 1500 calculations in loop like this and a target game frequency of 500 Hz(100 Hz game frequency and 5 sub-steps) ended up in 20 FPS. That's incredibly bad result(especially knowing that I have decent laptop CPU(2.3 GHz, 4 cores). I am using Python and after a few analysis I found the problem - it turns out that Python is incredibly bad at for loops, like 50 times slower that C++ or Java. Hm... I didn't expect this. I am wondering - can I somehow optimize Python for loops and/or class access?   This isn't that important anyways as I'm using Python only for test stage(as it's incredibly easy to code in Python), I'll switch to C++ after.
  13. I am facing a problem that calculating length of many vectors leads to huge performance drops and I am pretty much sure that the main reason is the square root algorithm that the programming language uses. What I thought - is there any faster, yet accurate approximation that I could use for the vector length calculation? Either faster square root equation or whole different vector length calculation.   Thanks!
  14. adriansnetlis

    How To Correctly Caluclate Compression Speed For Damping?

    I always use symplecit Euler. I thought that I used explicit one, but than I found out that explicit Euler uses last frame velocity to integrate position and only than integrates velocity which doesn't make sense for me. I always integrate velocity first and than use it. However, it's easy to set the stiffness high enaugh to blow symplecit Euler. I also found it being ultra easy to blow RK4. I haven't yet tried verlet. I also haven't found out how it is possible to implement implicit Euler in game. And lastly - I gotta try out PBD as it seems to be the best stability and performance balance yet made for stiff spring system. ;)   Also it seems that previously I calculated the spring velocity implicitly, but in unsuitable case?
  15. adriansnetlis

    How To Correctly Caluclate Compression Speed For Damping?

    Hi! Thank you very much. This seems to be exactly what I need. I'm glad that I asked it here:)
  • Advertisement
×

Important Information

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

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

Sign me up!