Raised This Month: $ Target: $400
 0% 

Move entity problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 12-17-2014 , 06:49   Move entity problem
Reply With Quote #1

Hi,
I'm currently using this stock by CHW_Chronic to move entity from point to point:
PHP Code:
stock get_speed_vector(const Float:origin1[3],const Float:origin2[3],Float:speedFloat:new_velocity[3])
{
    
new_velocity[0] = (origin2[0] - origin1[0])
    
new_velocity[1] = (origin2[1] - origin1[1])
    
new_velocity[2] = (origin2[2] - origin1[2])
    new 
Float:num floatsqroot(speed*speed / (new_velocity[0]*new_velocity[0] + new_velocity[1]*new_velocity[1] + new_velocity[2]*new_velocity[2]))
    
new_velocity[0] *= num
    new_velocity
[1] *= num
    new_velocity
[2] *= num

    
return 1;

However, when I increase the speed, the entity start to fly off track. What's wrong with it?

Last edited by RateX; 12-20-2014 at 06:59.
RateX is offline
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 12-19-2014 , 12:55   Re: Move entity problem
Reply With Quote #2

I discovered that at around 60m/s or higher, the entity start to fly off track. Anyone good at maths can solve the problem?

--EDITED--
I attached below the test result and the plugin I use to test this.
Attached Files
File Type: sma Get Plugin or Get Source (move_ent_test.sma - 542 views - 4.6 KB)

Last edited by RateX; 12-20-2014 at 07:09.
RateX is offline
Reply


Thread Tools
Display Modes

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 15:19.


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