Jump to content

pivot angle


cassius
 Share

Recommended Posts

Hi

How do I find the angle of a pivot so I can express it in UpdateController?

 

In the code below I get the error "can't convert from tvec3 to float" in updatecontroller angle parameter ( Blitzmax)

I need the controller to move in direction of player

 

 

pointEntity(bg_pivot,player)

PointEntity(badguy,player)

 

If stopanim2 = False

If EntityDistance(jane,badguy) > 2.0 And EntityDistance(jane,badguy) < 16

turn = EntityRotation(bg_pivot,1)

bg_framebegin = 77

bg_frameend = 115

animate_badguy() ' badguy walk

UpdateController(bg_control,turn,3.0,0, 0, 1,400,0)

Endif

 

EndIf

amd quad core 4 ghz / geforce 660 ti 2gb / win 10

Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++

Link to comment
Share on other sites

As the error says Cass, "can't convert from tvec3 to float" ... turn is a Vec3 but the UpdateController wants a float, so try turn.y which is the y value of the Vec3

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Thanks mg. I changed it to turn.y and got no error message, but the enemy character has now disapeard so must be something else wrong.

 

EDIT: Is it ok to parent the controller to the pivot?

amd quad core 4 ghz / geforce 660 ti 2gb / win 10

Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++

Link to comment
Share on other sites

which pivot? you seem to be pointing two things at the player? why not badguy.rotation.y?

 

PointEntity( TEntity entity1, TEntity entity2, int axis=3, flt rate=1, flt roll=0 )

 

PointEntity(badguy, player,3,1.0)

If stopanim2 = False
 If EntityDistance(jane,badguy) > 2.0 And EntityDistance(jane,badguy) < 16.0
	  bg_framebegin = 77
	  bg_frameend = 115
	  animate_badguy() ' badguy walk
	  UpdateController(bg_control,badguy.rotation.y,3.0,0, 0, 1,400,0)
 Endif
EndIf

 

 

 

 

I try and avoid parenting.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Ok thanks. I think I am slowly getting there. Been messing around for two weeks.

When it comes to pointentity I get confused between the character(badguy) its controller ( bg_control) and the pivot bg_pivot

amd quad core 4 ghz / geforce 660 ti 2gb / win 10

Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++

Link to comment
Share on other sites

No need for the pivot bg_pivot, just steer your bg_control with the badguy mesh.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Thanks mg. Your code worked fine, exept the enemy character flickers wildly when close to main character. It did that a bit when I used moveentity but not as bad. Anyone know why?

amd quad core 4 ghz / geforce 660 ti 2gb / win 10

Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++

Link to comment
Share on other sites

I have never had this problem myself, so its hard to speculate without demo/code/video.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...