Comments (4)
Thank you very much for you rapid and detailed answer! It helped!
from bulletsharp.
It depends on the version of BulletSharp, but it's usually a class called Matrix.
Your IDE should suggest the right type when you type in:
colMapObject = new CompoundShape()
colMapObject.AddChildShape(
from bulletsharp.
Yeah, I know that the Matrix should be passed as an argument. I use bullet sharp 3 and VS2017. But I didn't found a method in Matrix that will create it from Quaternion and Vector3 as in original btTransform. That's why I asked it.
from bulletsharp.
I mean it depends on whether it's the generic version or a version that uses types from a graphics library like OpenTK/SharpDX/etc.
The generic version has no special Matrix constructors, but you can always multiply a rotation matrix and a translation matrix.
Matrix rotation = Matrix.RotationQuaternion(new Quaternion(0, 0, 0, 1));
Matrix translation = Matrix.Translation(x, y, z);
Matrix transform = rotation * translation;
colMapObject.AddChildShape(transform, sphere);
See here about multiplying matrices:
https://docs.microsoft.com/en-us/windows/desktop/direct3d9/transforms#concatenating-matrices
With a Matrix class from some other framework, you can do the same, except if the matrix layout is different (like in OpenTK), you may have to reverse the multiplication order to translation * rotation.
In this particular case, since (0, 0, 0, 1) is an identity quaternion that specifies no rotation, you could just use the translation matrix: colMapObject.AddChildShape(Matrix.Translation(x, y, z), sphere);
The generic version of BulletSharp has math classes based on SlimDX:
https://slimdx.org/docs/#T_SlimDX_Matrix
However, the Matrix.Transformation constructor that takes a rotation quaternion and a translation vector has been removed since it depends on DirectX.
from bulletsharp.
Related Issues (20)
- how to compile dll from src? HOT 1
- Hi Vb.net developer issue when I try to remove ridgid body!!! HOT 3
- Stop simulate HOT 9
- Why does BasicDemo have many errors??? HOT 2
- Bullet Physics Version Update HOT 4
- Problem with BulletSharp with Debug x64 and Release x64 HOT 2
- MultiThreadedDemo, A heap has been corrupted exception HOT 3
- Build instructions for non C++ developers HOT 2
- Link is broken for downloading x64 release HOT 1
- AccessViolationException while BulletSharp.DynamicsWorld.StepSimulation HOT 2
- Example without Demo UI
- .NET Core compatibility HOT 6
- Strange behaviour HOT 4
- UnhandledException : Removing object that is not being tracked. at Finalize() HOT 2
- How can BulletSharp.dll be built as AnyCPU .dll HOT 1
- BulletSharp, OpenTK & Scale HOT 4
- Unhandled Exception on ~btGImpactMeshShape()
- C# Demo Build Issues - Consistent Versions of Dependencies? HOT 1
- Passing Through object
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bulletsharp.