Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated ammo.js and added some functions #15

Merged
merged 5 commits into from
Dec 23, 2017

Conversation

guzzard
Copy link
Contributor

@guzzard guzzard commented Dec 21, 2017

All tested in JS and C++

@guzzard
Copy link
Contributor Author

guzzard commented Dec 21, 2017

While testing I used cast(_shapeConvex, BtCapsuleShapePointer), and it worked fine in JS. But in C++ I had to force a static_cast in order to cast BtConvexShapePointer into BtCapsuleShapePointer. Is this normal or am I missing something?

else if (shape == ControllerShape.Capsule) {
	var r = transform.dim.x / 2;
	_shapeConvex = BtCapsuleShapeZ.create(
		withMargin(r), // Radius
		withMargin(transform.dim.z - r * 2)); // Height between 2 sphere centers

	#if cpp
	var capsule:BtCapsuleShapePointer = null;
	untyped __cpp__('capsule = static_cast<btCapsuleShape*>(_shapeConvex)');
	trace("capsule: " + capsule.getUpAxis() + " " + capsule.getRadius() + " " + capsule.getHalfHeight());
	#end
}

@luboslenco luboslenco merged commit 6aa5c24 into armory3d:master Dec 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants