Hi
Out of curiosity I made a small free falling object terminal velocity (Vt) test with constant atmosphere density.
I use Vt formula from wiki
Sphere.o_CalVt = sqrt((Sphere.o_mass * 9.81 * 2) / (Sphere.o_atm * Sphere.o_area * Sphere.o_cd ))
Set falling object data
Sphere.o_mass = Cube.getMass() # Give object mass in Logic-ui (F4)
Sphere.o_area = 0.005026548 # Cross area towards motion (m2)
Sphere.o_cd = 0.34 # Coefficiency of Drag for the ball
If your object don’t reach the Vt during the fall, then adjust the start height(Loc Z) from Tranform Properties ui.
The o_velocity: current velocity (ms)
The o_alt: current altitude (m/bu)
The o_MaxV: recorded max speed during simulation (ms)
The o_CalVt: calculated Vt (ms)
import Blender
import Rasterizer
import math
from math import *
# #-----------------------------------------------------------------------------
# # get controllers
controller = GameLogic.getCurrentController() # get controller
Sphere = controller.getOwner() # get your object
acc1 = controller.getActuator("acc1") # Get sensor named
# #-----------------------------------------------------------------------------
# # Initialized
if hasattr (Sphere, 'int') == False:
Sphere.int=1
Sphere.o_atm = 1.21 # atmosphere density
# Set falling object data here!!!
Sphere.o_mass = Sphere.getMass() # Give object mass in Logic-ui (F4)
Sphere.o_area = 0.005026548 # Cross area towards motion (m2)
Sphere.o_cd = 0.34 # Coefficiency of Drag for ball
Sphere.o_drag = 0.0 # (N)
Sphere.o_velocity = 0.0 # (m/s)
Sphere.o_alt = 0.0 # (m)
Sphere.o_MaxV = 0.0 # (ms)
Sphere.o_CalVt = 0.0 # (ms)
# #-----------------------------------------------------------------------------
# # Get altitude
Sphere.o_alt = round(Sphere.getPosition()[2],0)
# #-----------------------------------------------------------------------------
# # Get current velocity
Sphere.o_velocity = (hypot((Sphere.getVelocity()[0]),(hypot((Sphere.getVelocity()[1]),(Sphere.getVelocity()[2]))))) # get true
if Sphere.o_MaxV < Sphere.o_velocity:
Sphere.o_MaxV = Sphere.o_velocity
# #-----------------------------------------------------------------------------
# # Calculate Drag
Sphere.o_drag = (0.5 * Sphere.o_velocity**2 * Sphere.o_atm * Sphere.o_area * Sphere.o_cd )
# #----------------------------------------------------------------------------
# # Set forces
acc1.setForce(0.0,0.0,Sphere.o_drag ,0)
# #-----------------------------------------------------------------------------
# Calculated terminal velocity
Sphere.o_CalVt = sqrt((Sphere.o_mass * 9.81 * 2)/(Sphere.o_atm * Sphere.o_area * Sphere.o_cd ))
# #-----------------------------------------------------------------------------
GameLogic.addActiveActuator(acc1,1)
Attachments
Physics_falling_object_Vt.blend (155 KB)