The online racing simulator
[PAY] Need someone who can help me with insim location for AS2Y.
Hello..

My insim is almost working fine.. but the location is a big problem for me, If I will load AS2Y on the server, noting will happen, only a button with "spectators" show up. So my question, maybe someone can help me with the location, if you can help me I will pay you, no problemo.

So send me a pm or post here somthing, you can acces my server with "Teamvieuwer" or "WRM (Windows Remote Desktop)"

So please guys, help me
Are you trying to use track nodes to get a car's location on the circuit? There are no track nodes in open configs so it obviously doesn't work. You can define areas on the track using X,Y coordinates. This is very easy for rectangular areas and a bit more complex for areas in a shape of an arbitrary polygon. Sample code for both approaches is available on the forum.
For me it's a bit hard to understand, maybe can you help me? I will pay you tommorow? Send pm please

Maybe you can have a look to the code, server is 24/7 online so if you wanna help send pm for login details

Many thanks!!!
Does this help? (the code is obviously not PHP, I just like the syntax highlighting)


<?php 
/** Casts a ray from the tested point onwards
 *  along the X axis to determine if the point
 *  is inside or outside the area.
 *  Odd number of intersections means the point is inside the area.
 */
bool Area::contains(const Pointp)
{
  
int pX p.x();
  
int pY p.y();
  
bool inside false;
  
  
/* Start with the segment made of last vertex (j = SIZE - 1) and first vertex (i = 0) of the polygon */
  
for (unsigned int j 0_vertices.size() - 1_vertices.size(); j++) {
    if (
pY _vertices[i].y() != pY _vertices[j].y()) { /* Can the segment cross the ray vertically? If it cannot, skip it. */
      /* WARNING: Magic ahead.
       * If anybody wonders why this works, imagine that the formula below is nothing but an inverse linear function equation X = K*Y + Q
       * where K = dX / dY and Q is the X coordinate of the starting point of the segment (note that the segments are created backwards).
       * By solving this equation and comparing the result to pX we can tell whether the segment is "ahead of" or "behind" the tested point on the X axis
       * at a given pY coordinate. If it is behind, the cast ray does not intersect the segment.
       * (It's better to grab a piece of paper and visualise the whole solution) */
      
float shift = ((float)(_vertices[i].x() - _vertices[j].x()) / (float)(_vertices[i].y() - _vertices[j].y())) * (pY _vertices[j].y()) + _vertices[j].x();
      if (
pX shift)
          
inside = !inside;
    }
    
j;
  }
  
  return 
inside;
}
?>

Point is a class or struct that contains X and Y coordinates and _vertices is a set of points making a polygon. The algorithm above returns true if the point "p" is inside the polygon and false if it is not.
Hmmm, so first many thanks for the reply! So I need to place to code in Form.cs? I will try somthing with the code thanks!

FGED GREDG RDFGDR GSFDG