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 Classic Chat / 3d physics + tilt control Agk 2.0.15 help

Author
Message
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 20th Oct 2015 16:47
I have managed to impliment the 3d physics into my editor, but what I could do with is a small example of moving a sphere with tilt but using the 3d physics functions this time!
Any offers? just a cube and a sphere will do!
Hail to the king, baby!
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 20th Oct 2015 18:23 Edited at: 20th Oct 2015 18:25
i understand you want rotate a sphere with physics,true?
should be a command with "torque".
and from device
GetDirectionX ()
GetDirectionY ()
(The direction is an emulated value that will use an accelerometer where available or keyboard arrow keys if not. )
AGK (Steam) V2 Beta .. : Windows 10 Pro 64 Bit : AMD (15.7.1) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 20th Oct 2015 18:28
cannot see a command with torque
Hail to the king, baby!
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 20th Oct 2015 19:54
Ah! nm.. after some reading and stuff I found out it was SetObject3DPhysicsLinearVelocity command, along with GetDirectionX () ... GetDirectionY () of course!
Hail to the king, baby!
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 20th Oct 2015 20:05
or maybe this SetObject3DPhysicsAngularVelocity

normal the Velocity is a result of adding a force.
i missing some 3d physics commands.
AGK (Steam) V2 Beta .. : Windows 10 Pro 64 Bit : AMD (15.7.1) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 20th Oct 2015 20:45
well..you might be right, not sure, I think I have tried that!
Anyhow this aint working!


I guess it is the initial speed param...

Anyone got any ideas how it is done?
Hail to the king, baby!
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 20th Oct 2015 21:15
can u copy the parameters from help, me just removed alpha and switched back to normal version in steam.
AGK (Steam) V2 Beta .. : Windows 10 Pro 64 Bit : AMD (15.7.1) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 20th Oct 2015 21:24 Edited at: 20th Oct 2015 21:24









The above 3 are about the only possible ones
Hail to the king, baby!
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 20th Oct 2015 22:08
i got only crash here and there ... can not help.
AGK (Steam) V2 Beta .. : Windows 10 Pro 64 Bit : AMD (15.7.1) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 20th Oct 2015 22:22
well, you would do being on an older version! right?!
Hail to the king, baby!
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 20th Oct 2015 23:42 Edited at: 21st Oct 2015 18:11
me used the current alpha at steam.
i guess its the 2.0.15 Alpha because paul wrote about the new 3d commands in a thread.

some commands must used.

my current state
edit:removed
AGK (Steam) V2 Beta .. : Windows 10 Pro 64 Bit : AMD (15.7.1) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 21st Oct 2015 11:04
hmm! It just bobbles around doesnt it, I really want the movement I had with droidball. the problem is I can only use a fixed initial speed( the last parameter of these commands) which is no good as far as the needed inertia is concerned
Hail to the king, baby!
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 21st Oct 2015 11:19
What if you adjust the physics gravity based on the GetDirectionx/y results? That would work... I'd knock up an example for you but my phone died last week and I haven't got around to replacing it yet so I can't test.
V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 21st Oct 2015 11:20
i know, i try this in the morning before work, i believe it hangs in the plane and the MoveObjectLocalY seems not move my object up.
without Create3DPhysicsStaticPlane the sphere fall out of screen.
my crashes was because i not used Create3DPhysicsWorld or something.
and this Step3DPhsyicsWorld was a must have, else nothing is moving.

AGK (Steam) V2 Beta .. : Windows 10 Pro 64 Bit : AMD (15.7.1) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 21st Oct 2015 11:30 Edited at: 21st Oct 2015 11:46
I had written this function to set up the objects physics within my editor:



So after creating a object just call that with the values you need... it expects myphyshape to be either a 1(sphere) or a 2(box) and myphybody to be a 1(static) or 2(dynamic)
So saying... createobjectphysics(10,1,2) would give me a dynamic sphere with an ID of 10.

Also you can set the gravity at the top of your program with:
Set3DPhysicsGravity(0,-4,0)
just after:
Create3DPhysicsWorld()


Here is how far I got, you will see me load it into my own editor first, the one I wrote for droidball...
Hail to the king, baby!
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 21st Oct 2015 11:50
Quote: "I had written this function to set up the objects physics within my editor"


I like this approach! Obviously it would need to be tweaked for individual circumstances (such as maybe include a Case 3 for myphybody if you need Kinemetic bodies, or other shapes added to the myphyshape cases etc.). Looks good! Can't wait to see what people make with these new commands. Exciting times!



V2 T1 (Mostly)
Phone Tap!
Uzmadesign
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 21st Oct 2015 12:25 Edited at: 21st Oct 2015 12:26
yes of course you can, it is just a case of.... more cases!
Hail to the king, baby!
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 21st Oct 2015 18:12
current state but not tested with sensor.
AGK (Steam) V2 Beta .. : Windows 10 Pro 64 Bit : AMD (15.7.1) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 21st Oct 2015 18:51 Edited at: 21st Oct 2015 18:51
Not bad so far, seems to bobble off course near the end, needs inertia... well for my needs!
Hail to the king, baby!
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 21st Oct 2015 21:33
Here's a little example of using gravity and tilt to control stuff. Tilt device to control balls in a box. I think this fulfills your original request:
Quote: "small example of moving a sphere with tilt"


V2 T1 (Mostly)
Phone Tap!
Uzmadesign
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 22nd Oct 2015 09:57 Edited at: 22nd Oct 2015 10:03
that is pretty cool tnx! Abit of a hacky way I would say!

It is a shame that the 3d physics aint as up to par as the 2d physics else this would be much more achievable!
Anyhow I had realised that I cannot account for wedge shapes with physics, and I have ramps as a feature of droidball.
So will have to put using physics for it on the back burner, I do hope the 3d physics is still being developed and will add other commands?!
In it's current state though something like a platformer is pretty do-able.
Hail to the king, baby!
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 22nd Oct 2015 11:32
You could use static planes, or convex hulls for your wedges. How is the 3d physics not as up to par?

Quote: "bit of a hacky way I would say!"
Whatever works right?


V2 T1 (Mostly)
Phone Tap!
Uzmadesign

Login to post a reply

Server time is: 2024-09-29 05:31:54
Your offset time is: 2024-09-29 05:31:54