Raised This Month: $ Target: $400
 0% 

Entity Circular Translation Movement


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
XSlayer
Member
Join Date: Dec 2021
Old 12-09-2021 , 23:06   Entity Circular Translation Movement
Reply With Quote #1

Hi i wanted to make an entity travel around an origin, i have origin 1(center) and origin2(start), and i have start velocity, but i dont know how to make the circle direction,


Last edited by XSlayer; 12-09-2021 at 23:07.
XSlayer is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 12-10-2021 , 03:13   Re: Entity Circular Translation Movement
Reply With Quote #2

I would form it like the following...


In entity think

Isnt Entity In radius?
NewOrigin = Origin One + Entity Left/Right Vector
MoveToNewOrigin

Else

RotatePointByAngle
MoveToOrigin


Here is the function RotatePointByAngle

You just need to rephrase the code to pawn language.
PHP Code:
POINT rotate_point(float cx,float cy,float angle,POINT p)
{
  
float s sin(angle);
  
float c cos(angle);

  
// translate point back to origin:
  
p.-= cx;
  
p.-= cy;

  
// rotate point
  
float xnew p.p.s;
  
float ynew p.p.c;

  
// translate point back:
  
p.xnew cx;
  
p.ynew cy;
  return 
p;

__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 12-10-2021 at 08:42.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:39.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode