Forum Replies Created
-
AuthorPosts
-
This is great! Thank you so much Mark!
Maybe DruggedBunny can add some input but this is what I have been looking at:
btPoint2PointConstraint Class Reference
Snippet of Panda3D’s Implementation
Bullet – Chain Tutorial (Using Point2Point/Ball Socket Constraints)
You could start with either but I feel like the 2 body-2pivot point2point will help you see if it’s actually working or not – not really sure when someone would use 1 body-1 pivot.
I was thinking of the actual user-facing code looking something like:
Monkey123456789101112131415161718192021222324Function Setup()Local Cone1:=Model.CreateCone( 2.5, 5, Axis.Y, 32, New PbrMaterial( Color.Red ), Null )Cone1.Move( 0, 20, 0 )Local Cone1Rigid:=New RigidBody( Cone1 )Local Cone1Tip:= New Vec3f '(Position of tip of cone)Local Cone2:=Model.CreateCone( 2.5, 5, Axis.Y, 32, New PbrMaterial( Color.Green ), Null )Cone2.Move( 0, 20, 0 )Cone2.Rotate( 0, 0, 180 )Local Cone2Rigid:=New RigidBody( Cone2 )Local Cone2Tip:= New Vec3f '(Position of tip of cone)'Local Link:Constraint = New Point2PointConstraint(Cone1Rigid, Cone2Rigid, Cone1Tip, Cone2Tip) ...OrLocal Link:Constraint = New BallSocketConstraint(Cone1Rigid, Cone2Rigid, Cone1Tip, Cone2Tip)#remPossible Commands:Constraint.SetPivot(someVec3, Null) 'set PivotA and keep/ignore PivotBConstraint.GetPivot(pivA, pivB) 'return pivots/vectorsConstraint.SetLimits() 'not 100% on how limits would work#endEndGoing to be honest I have never really dealt with constraints and if you need me to find some more examples/references I absolutely will. Having said all that, Point2Point looks like it really dives right into it and I think once you get this, other constraints like Hinge etc. should be a bit easier – if you’re up for the challenge!
Edit: Couple more links:
Bullet Manual – Page 23 (Constraints)
Bullet – Bridge Tutorial (Uses Point2Point Constraints)
Aww Yiss!
It’s not anything so far —
Bullet:
Monkey123456789101112Class btTypedObject Extends btObjectEndClass btTypedConstraint Extends btTypedObjectEndClass btPoint2PointConstraint Extends btTypedConstraintMethod New( rbA:btRigidBody, rbB:btRigidBody, pivotInA:btVector3, pivotInB:btVector3 )Method New( rbA:btRigidBody, pivotInA:btVector3 )Endmojo3d/scene/components/constraint:
Monkey1234567891011121314151617181920Namespace mojo3dPrivateClass Constraint Extends ComponentEndClass Point2PointConstraint Extends ConstraintMethod New( rigid1:btRigidBody, rigid2:btRigidBody, pos1:Vec3f, pos2:Vec3f)Local btVec1:=New btVector3(pos1.x, pos1.y, pos1.z)Local btVec2:=New btVector3(pos2.x, pos2.y, pos2.z)_btConstraint = New btPoint2PointConstraint(rigid1, rigid2, btVec1, btVec2)EndField _btConstraint:btPoint2PointConstraintEndTrying to implement it myself — I have added the class in the bullet module. I decided to make a new “constraint” class for mojo3d but when I call on the bullet command btPoint2PointConstraint, I get:
bullet3-2.85.1/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h:77:2: note: no known conversion for argument 1 from ‘btRigidBody*’ to ‘btRigidBody&’
It passes the btRigidBody(s) and btVector3(s) but appears Var is still not implemented so I am unsure how to pass references instead of pointers.
Any ideas?
DruggedBunny were you ever able to get ball socket/point2point constraints working?
Great work Ethernaut!
Sorry perhaps texture was the incorrect word? The MTL file that is with it, from my understanding, contains placements for colors and such. Assimp Viewer loads both and renders just fine but Mojo3D does not.
You need to be more specific. What do you mean you can’t load the gltf files?
Perhaps the texture file that it is using isn’t compatible. I used an app called AssetForge and it exported an OBJ and MTL. I’ve attached an example.
Attachments:
Even though the test calls for mojo3d-assimp, it’s not a module. Replace with mojo3d-loaders
Thank you! Thats exactly what I am after. I am able to set the button image and alter colors on hover and active but how do I change the image? To change colors you change iconColor but to change the image I have tried image, icon, etc and none of them seem to do the trick…
Also what is the attribute called when you hover a standard button and a darker border appears around it?
Yikes, I apologize Jesse. I did not run it on a macbook, I used Windows 7. I must have skimmed over that part in the post earlier… I’m getting married tomorrow and I’ve been all over the place today.
If you mean ufomanager.monkey2 and the line you are talking about is “Global this:= EntityState.ENTERING” then the error I get is:
Monkey1234567891011121314151617181920212223242526mx2cc version 1.0.5***** Building app 'C:/Users/Admin/Desktop/MissionPatrol/MissionPatrol.monkey2' *****Parsing...Semanting...Translating...Compiling...Build error: System command 'g++ -std=c++11 -m32 -I"C:/Workbench/Monkey2-v1.0.5/modules/freetype/freetype-2.6.3/include/" -I"C:/Workbench/Monkey2-v1.0.5/modules/openal/openal-soft/include/" -I"C:/Workbench/Monkey2-v1.0.5/modules/gles20/angle/include/" -I"C:/Workbench/Monkey2-v1.0.5/modules/sdl2/SDL/include/" -I"C:/Workbench/Monkey2-v1.0.5/modules/monkey/native" -I"C:/Workbench/Monkey2-v1.0.5/modules/" -I"C:/Users/Admin/Desktop/MissionPatrol/" -c -o "C:/Users/Admin/Desktop/MissionPatrol/MissionPatrol.buildv1.0.5/windows_debug/build/_1src_2MissionPatrol_0game_02levels.cpp.o" "C:/Users/Admin/Desktop/MissionPatrol/MissionPatrol.buildv1.0.5/windows_debug/src/MissionPatrol_game_2levels.cpp"' failed.g++ -std=c++11 -m32 -I"C:/Workbench/Monkey2-v1.0.5/modules/freetype/freetype-2.6.3/include/" -I"C:/Workbench/Monkey2-v1.0.5/modules/openal/openal-soft/include/" -I"C:/Workbench/Monkey2-v1.0.5/modules/gles20/angle/include/" -I"C:/Workbench/Monkey2-v1.0.5/modules/sdl2/SDL/include/" -I"C:/Workbench/Monkey2-v1.0.5/modules/monkey/native" -I"C:/Workbench/Monkey2-v1.0.5/modules/" -I"C:/Users/Admin/Desktop/MissionPatrol/" -c -o "C:/Users/Admin/Desktop/MissionPatrol/MissionPatrol.buildv1.0.5/windows_debug/build/_1src_2MissionPatrol_0game_02levels.cpp.o" "C:/Users/Admin/Desktop/MissionPatrol/MissionPatrol.buildv1.0.5/windows_debug/src/MissionPatrol_game_2levels.cpp"C:/Users/Admin/Desktop/MissionPatrol/MissionPatrol.buildv1.0.5/windows_debug/src/MissionPatrol_game_2levels.cpp: In member function 'virtual bbInt t_default_Stage1::m_Update()':C:/Users/Admin/Desktop/MissionPatrol/MissionPatrol.buildv1.0.5/windows_debug/src/MissionPatrol_game_2levels.cpp:95:67: error: 't_default_EntityState' was not declared in this scopeif((this->m_ufoManager->m_state==bbInt(t_default_EntityState(1)))){^***** Fatal mx2cc error *****Internal mx2cc build errorThat did the trick. Thanks Mark! I closed the github issue for it.
-
AuthorPosts