armory3d / haxebullet Goto Github PK
View Code? Open in Web Editor NEWBullet 3D Physics for Haxe
Home Page: http://bulletphysics.org
License: zlib License
Bullet 3D Physics for Haxe
Home Page: http://bulletphysics.org
License: zlib License
I think the aim of the code sample, was to showcase a ball bumping against ground. However when ruining it, the trace(trans.getOrigin().y());
goes in negative numbers. What's missing?
Hi Lubos,
I've been sifting through Bullet's docs and forums to find how to process collisions. My first use case is to detect collisions of certain objects with the player, for which the gContactProcessedCallback
method from http://www.bulletphysics.org/mediawiki-1.5.8/index.php?title=Collision_Callbacks_and_Triggers seems well suited. However I'm not sure how to use the bindings to achieve this or what to add to the bindings. I'm wondering if you have any advice on how to process collisions in general.
Thank you for your time
On Android 4.4 application crashes on dynamicsWorld.stepSimulation(1/60) call. I also tested It on Android 5.0, linux, html5 and it works fine. There are no any errors in logcat and I don't know how to capture this error. Can somebody suggest solution? I tested on 2 smartphones with Android 4.4.2 and 4.4.3, both crashes
haxelib.json disappeared in this commit: https://github.com/armory3d/haxebullet/tree/bce65966e086432981fc4c17b5818229c636ad84
It was present in the previous one, as can be seen here: https://github.com/armory3d/haxebullet/tree/2b87efd5ce0b23732a90828f7fb121379c7cf494
Without a haxelib.json, lime-based projects can't find the proper classPath, and can't resolve any classes as a result. I was previously on a very old commit which still had the haxelib, so this only recently caused me trouble when I upgraded xD
Hi, in the cpp build I'm still getting "error C2512: 'btRigidBody': no appropriate default constructor available" (which is a repeated problem with other files, ie btDiscreteDynamicsWorld).
I tried this type of construction, but not really sure what to do at this point : #19
I was looking around because I needed some extra bindings that I found were not in Bt.hx but were in the WebIDL and I found that the Javascript bindings were not generated automatically yet.
haxebullet/Sources/bullet/Bt.hx
Line 11 in a5a8649
If it is worth your time to explain, I might be able to do the work to get that done. Before I started on anything I just wanted to make sure you haven't already figured out what we need to do. If it isn't worth the time right now, no problem, I don't care either way, I'll just add the extra bindings that I need to Bt.hx for now.
We have encountered some situations where it becomes very handy for armory project.
Trying to get this to compile on cpp (JS is fine) and need a base var. I don't know what to plug in for the BtStridingMeshInterface.
I get the error: "cannot construct a btStridingMeshInterface, no constructor in IDL" because it's an interface.
Thinking about sticking some kind of tri or collision shape in there but not really sure which.
public var fallRigidBody:BtRigidBody = BtRigidBody.create(BtRigidBodyConstructionInfo.create
(
0,
BtDefaultMotionState.create(BtTransform.create(), BtTransform.create()),
BtBvhTriangleMeshShape.create(BtStridingMeshInterface.create(), false, false),
BtVector3.create(0, 0, 0)
));
I tried to set a m_frictionSlip at the wheels in the VehicleBody.hx code, from full zero to a 30000.0, but this did not lead to anything, the car still clings to the road, like a train on the rails โฆ
I also tried to set the friction to 0.0 at the ground, but even so, there is no difference, the car clings to the ground tightly.
More: http://forums.armory3d.org/t/how-to-make-drift-car/2305/1
I'm on Haxe 3.2.0 (afraid of migrating because of my the legacy openfl/lime/haxeflixel stuff I use for other projects), and I'm having some trouble building the most recent commit. I'm using hxcpp 3.3.49 (which I think is the latest on haxelib).
Here's what the compiler outputs:
Error: While running :cl.exe -Iinclude -IC:\HaxeToolkit\haxe\lib\haxebullet/git/Sources/../cpp/bullet -nologo /WX- /fp:precise -DHX_WINDOWS -D_USING_V120_SDK71_ -GR -Od -Zi -FdC:\Users\Anon\Desktop\HAXEDEV\BlipEngine\bin\windows\cpp\debug\obj\obj/msvc18-debug-ncxp/vc.pdb -FS -Oy- -c -EHs -GS- -arch:SSE -IC:/HaxeToolkit/haxe/lib/hxcpp/3,3,49/include -DHXCPP_DEBUG -DHXCPP_VISIT_ALLOCS -DHXCPP_CHECK_POINTER -DHXCPP_STACK_TRACE -DHXCPP_STACK_LINE -DHXCPP_API_LEVEL=321 -D_CRT_SECURE_NO_DEPRECATE -D_ALLOW_MSC_VER_MISMATCH -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -wd4996 -MT ./src/subsector/Player.cpp -FoC:/Users/Anon/Desktop/HAXEDEV/BlipEngine/bin/windows/cpp/debug/obj/obj/msvc18-debug-ncxp/025d0416_Player.obj
Player.cpp
./src/subsector/Player.cpp(153) : error C2819: type 'btRigidBody' does not have an overloaded member 'operator ->'
C:\HaxeToolkit\haxe\lib\haxebullet\git\cpp\bullet\BulletDynamics/Dynamics/btRigidBody.h(62) : see declaration of 'btRigidBody'
did you intend to use '.' instead?
./src/subsector/Player.cpp(153) : error C2232: '->btCollisionObject::setUserIndex' : left operand has 'class' type, use '.'
Here's Player.cpp(153):
this->phys->body->get_value()->setUserIndex((int)666);
And this is the original Haxe line:
phys.body.value.setUserIndex(666);
body
is a cpp.Pointer, so it seems that the generated code mistakes the return value of the get_value() for a pointer. Is this just a Haxe 3.2/3.3 incompatibility?
For web it's nice and cozy (in project.xml): <dependency if="web" path="dependencies/ammo.js" />
For cpp on the other hand, I just couldn't find any info about adding header/source files. I suppose I would have to inject it into the hxcpp build process somehow but I have no clue how that can be done.
Hi,
on my machine I have haxe 3.1.3 and hxcpp 3.2.81 and this line in Bullet.hx:
@:include("LinearMath/btVector3.h")
generates this line in Main.cpp file:
#include <LinearMath/btVector3.h.h> // (note the double .h.h !!)
Removing ".h" from @:include generates correct path in Main.cpp.
It would be nice if you could create a simple test project that will show us the right way of
haxebullet usage. How do you integrate it into your build process without having to manually change stuff for every different cpp target ?
At the moment my code looks something like this
class BGame extends BGroup {
#if cpp
public var world:Pointer<BtDiscreteDynamicsWorld>;
#else
public var world:BtDiscreteDynamicsWorld;
#end
}
Luckily .value() works equivalently in js and cpp targets, but I still feel like these conditionals are annoying. I also suppose ammo.js has automatic garbage collection, but in cpp we need to call pointer.destroy(), right?
I think those are the only two things keeping the js and cpp versions not fully unified.
I'm on the latest haxebullet version, but still on Haxe 3.2.0. This sample works fine with ammo.js and with older haxebullet versions, but on a latest version native build LocalInertia doesn't change at all after a calculateLocalInertia call, giving all bodies infinite rotational inertia as a result.
Sample:
var LocalInertia = BtVector3.create(0, 0, 0);
shape.ptr.calculateLocalInertia(Mass, LocalInertia.value);
trace(LocalInertia.value.x(), LocalInertia.value.y(), LocalInertia.value.z());
Output:
BPhys.hx:60: 0,0,0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.