Update the title + include version to be more description (after study, it seem it pulls the haxebullet repo)
Update (11/04/2018) The solution is in the second reply.
Hello,
Following is my current test version:
Armory 0.5 with Blender 2.7b
Target for Krom
Windows 10 Build
I was struggle to find a way to extend the haxebullet (Bullet.hx) within Armory3D
I updated Bullet.hx, but when using them in the vehicle.hx, specially following btWheelInfo class, newly added attributes are not populated with values (return null).
But base on native Bullet (c++), it should be populated, and the ammon.js also have that attribute.
Following BOLD letters are new attributes.
Following are my test codes
var wheelInfo:BtWheelInfo = vehicle.getWheelInfo(0); trace("wheel 0" ); trace(wheelInfo.m_suspensionStiffness); trace(wheelInfo.m_bIsFrontWheel); trace(wheelInfo.m_deltaRotation); trace(wheelInfo.m_wheelsRadius);
The original attribute m_suspensionStiffness will populate to 40.
While the other ones like
m_bIsFrontWheel
m_deltaRotation
m_wheelsRadius
are all null
in the trace
arm.VehicleBody:378: wheel 0 arm.VehicleBody:379: 40 arm.VehicleBody:380: null arm.VehicleBody:381: null arm.VehicleBody:382: null
For example:
like adding
public var m_rotation:BtScalar;
public var m_deltaRotation:BtScalar;
to Bullet.hx
#if js
@:native(‘Ammo.btWheelInfo’)
#elseif cpp
@:include(“BulletDynamics/Vehicle/btWheelInfo.h”)public static function create(ci:BtWheelInfoConstructionInfo):BtWheelInfo;
#end
public var m_wheelsRadius:BtScalar;
public var m_suspensionStiffness:BtScalar;
public var m_wheelsDampingCompression:BtScalar;
public var m_wheelsDampingRelaxation:BtScalar;public var m_frictionSlip:BtScalar;
public var m_steering:BtScalar;public var m_rotation:BtScalar;
public var m_deltaRotation:BtScalar;
public var m_rollInfluence:BtScalar;
public var m_maxSuspensionForce:BtScalar;
public var m_engineForce:BtScalar;
public var m_brake:BtScalar;
public var m_bIsFrontWheel:Bool;}
The new addition is like m_frictionSlip where it is public method in existing Bullet Physics h header file
BulletDynamics/Vehicle/btWheelInfo.h
https://github.com/armory3d/haxebullet/blob/master/cpp/bullet/BulletDynamics/Vehicle/btWheelInfo.h