﻿ What object is this cross in a circle?

• 0 Vote(s) - 0 Average
• 1
• 2
• 3
• 4
• 5
 What object is this cross in a circle? melex750 TrackedGrabber Posts: 43 Threads: 10 Joined: Sep 2015 Reputation: 21 #9 03-19-2016, 07:20 AM The "f" is used to express a literal float value in C++, it doesn't exist in CBOT. Code:```// orientation is the direction the object is facing. 0-360 // 0 and 360 == east // 90 == north and 180 == west // To calculate a point 5 meters behind an object float dist = -5.0; // <------change this to 5.0 to go in front of the object point pos = item.position; float ori = item.orientation; // calculate the difference float dx = dist * cos(ori);  // cos() is used for x float dy = dist * sin(ori);  // sin() is used for y // add that to object position pos.x += dx; pos.y += dy; goto(pos); turn( direction(item.position) );``` « Next Oldest | Next Newest »

 Messages In This Thread What object is this cross in a circle? - by Rinoldo - 03-18-2016, 10:43 AM RE: What object is this cross in a circle? - by krzys_h - 03-18-2016, 11:04 AM RE: What object is this cross in a circle? - by Rinoldo - 03-18-2016, 11:34 AM RE: What object is this cross in a circle? - by tomaszkax86 - 03-18-2016, 12:50 PM RE: What object is this cross in a circle? - by Rinoldo - 03-18-2016, 02:52 PM RE: What object is this cross in a circle? - by krzys_h - 03-18-2016, 02:51 PM RE: What object is this cross in a circle? - by tomaszkax86 - 03-18-2016, 07:04 PM RE: What object is this cross in a circle? - by Rinoldo - 03-19-2016, 04:32 AM RE: What object is this cross in a circle? - by melex750 - 03-19-2016, 07:20 AM RE: What object is this cross in a circle? - by Rinoldo - 03-19-2016, 03:59 PM RE: What object is this cross in a circle? - by Simbax - 03-19-2016, 05:02 PM RE: What object is this cross in a circle? - by Rinoldo - 03-26-2016, 06:05 PM RE: What object is this cross in a circle? - by krzys_h - 03-26-2016, 06:25 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)