Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Chat / Hinge joint

Author
Message
blink0k
AGK Developer
4
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 28th Dec 2017 05:14 Edited at: 28th Dec 2017 21:19
I'm trying to create a hinge joint for a spinner in my pinball app. I'm setting it up with this code
+ Code Snippet

The hinge is the bar at the center and the spinner is the large square area.


UPDATE : It was jittering because i had an invisible plane on top (glass cover) to stop the ball from bouncing out of the game. Now it looks like it is hinged at the center of the object but i need it to be hinged along the bar.



What am i doing wrong here?

Attachments

Login to view attachments
blink0k
AGK Developer
4
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 29th Dec 2017 03:03 Edited at: 29th Dec 2017 03:03
I added a small app that demonstrates the problem.

1. On the left you see a hinge joint at right angles. It works pretty good. This is pretty much what i want but i would have to figure out how to make it stand up straght

2. In the middle you see a model that has been rotated 45 degrees in my 3D proggy '

3. On the right you see the same model as #1 only rotated 45 degrees





I need the spinner to be 45 degrees. What am i doing wrong?

Attachments

Login to view attachments
micky4fun
4
Years of Service
User Offline
Joined: 15th Sep 2013
Location: uk essex
Posted: 29th Dec 2017 20:19 Edited at: 29th Dec 2017 20:22
Hi BlinkOk

First of all i cant help with the problem here , but thought i would say i am watching with interest this project and the car racing one as well , liked the track u last posted , looking very mariokart ish ,
I have just reload AGK2 on my new PC and as its winter here have just started to muck about with the 3D command side of the program , may in time come up with a simple 3D game who knows.
But for the time being, keep up these two projects and wish you luck with both and glad you are tinkering around with AGK


Mick
blink0k
AGK Developer
4
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 29th Dec 2017 22:32
Thanks matey! You have mail
blink0k
AGK Developer
4
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 29th Dec 2017 23:52 Edited at: 29th Dec 2017 23:52
Ok. Now i tried resting it in a grove which also doesn't work. the spinner just jumps around and falls off.
This is incredibly frustrating! This physics engine has fought me at every step, every single thing i try to do just doesn't work as expected.
Here are the shapes and attached is the project.

Attachments

Login to view attachments
blink0k
AGK Developer
4
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 30th Dec 2017 02:58 Edited at: 30th Dec 2017 02:58
Even dropping a cylinder onto two bars fails.

Attachments

Login to view attachments
Stab in the Dark software
Valued Member
15
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 30th Dec 2017 19:05
Quote: "
Creates a hinge joint between object a and b. The rotationVec3 paramter should be an axis in the form (0,1,0) for vertical, (1,0,0) for horizontal along the X axis, (0,0,1) for horizontal along the Z axis, or any combination of these. The rotation vector does not need to be normalized. Returns a joint ID. "


This is Paul's fault he changed the hinge axis vector to this system. I originally had it using a degree vector which allowed for arbitrary rotations.
The coffee is lovely dark and deep,and I have code to write before I sleep.
Stab in the Dark software
Valued Member
15
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 30th Dec 2017 19:16 Edited at: 30th Dec 2017 19:17
Wait I think I figured it out, try this vector for hinge 2

+ Code Snippet

Apparently it is a float between -1.0 and 1.0.
The coffee is lovely dark and deep,and I have code to write before I sleep.
blink0k
AGK Developer
4
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 30th Dec 2017 20:38
Ok great. What about the other issue with the cylinder and bars?
Stab in the Dark software
Valued Member
15
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 31st Dec 2017 03:36
Quote: "What about the other issue with the cylinder and bars?"


I did not see it in the demo you posted so not sure. From the picture it may not work
since currently AppGameKit does not handle concave objects for physics.
The coffee is lovely dark and deep,and I have code to write before I sleep.
blink0k
AGK Developer
4
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 1st Jan 2018 00:56
ok thanks
Hughbus
AGK Backer
4
Years of Service
User Offline
Joined: 24th Oct 2013
Location:
Posted: 8th Jan 2018 12:45
I was having similar issues with hinge joints, glad there Is a way! at of curiosity, how are you doing the custom collision geometry for your pinball table? is there commands for using the mesh as collision?
Markus
Valued Member
13
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 8th Jan 2018 15:10
i think for all static meshes should be used SetObjectShapeStaticPolygon
AGK (Steam) V2017.12.12 : Windows 10 Pro 64 Bit : AMD (17.12.1) Radeon R7 265 : Mac mini OS High Sierra (10.13)
Stab in the Dark software
Valued Member
15
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 8th Jan 2018 22:15
Quote: "i think for all static meshes should be used SetObjectShapeStaticPolygon"


Correct all static meshes need to be a static triangle mesh.
The command Create3DPhysicsStaticBody( objID ) automatically creates the physics object
with a static triangle mesh collision shape.
The coffee is lovely dark and deep,and I have code to write before I sleep.
Markus
Valued Member
13
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 8th Jan 2018 22:31 Edited at: 8th Jan 2018 22:31
oh, my thoughts, tilt did not work with a static pinball table ...
AGK (Steam) V2017.12.12 : Windows 10 Pro 64 Bit : AMD (17.12.1) Radeon R7 265 : Mac mini OS High Sierra (10.13)

Login to post a reply

Server time is: 2018-01-21 12:24:59
Your offset time is: 2018-01-21 12:24:59