Ejemplo n.º 1
0
void Translate_Object (ObjectPtr Object, const Vector3d& Vector, const TRANSFORM *Trans)
{
    if(Object == NULL)
        return;

    for(vector<ObjectPtr>::iterator Sib = Object->Bound.begin(); Sib != Object->Bound.end(); Sib++)
    {
        Translate_Object(*Sib, Vector, Trans);
    }

    if(Object->Clip != Object->Bound)
    {
        for(vector<ObjectPtr>::iterator Sib = Object->Clip.begin(); Sib != Object->Clip.end(); Sib++)
            Translate_Object(*Sib, Vector, Trans);
    }

    /* NK 1998 added if */
    if(!Test_Flag(Object, UV_FLAG))
    {
        Transform_Textures(Object->Texture, Trans);
        Transform_Textures(Object->Interior_Texture, Trans);
    }

    if(Object->interior != NULL)
        Object->interior->Transform(Trans);

    Object->Translate(Vector, Trans);
}
Ejemplo n.º 2
0
void LightSource::Translate(const Vector3d& Vector, const TRANSFORM *tr)
{
    Center    += Vector;
    Points_At += Vector;

    if(!children.empty())
        Translate_Object(children[0], Vector, tr);

    if(Projected_Through_Object != NULL )
        Translate_Object(Projected_Through_Object, Vector, tr);
}
Ejemplo n.º 3
0
void Translate_Object (OBJECT *Object, VECTOR Vector, TRANSFORM *Trans)
{
  OBJECT *Sib;

  if (Object == NULL)
  {
    return;
  }

  for (Sib = Object->Bound; Sib != NULL; Sib = Sib->Sibling)
  {
    Translate_Object(Sib, Vector, Trans);
  }

  if (Object->Clip != Object->Bound)
  {
    for (Sib = Object->Clip; Sib != NULL; Sib = Sib->Sibling)
    {
      Translate_Object(Sib, Vector, Trans);
    }
  }

  /* NK 1998 added if */
  if (!Test_Flag(Object, UV_FLAG))
  {
    Transform_Textures(Object->Texture, Trans);
    Transform_Textures(Object->Interior_Texture, Trans);
  }

	if (Object->UV_Trans == NULL)
		Object->UV_Trans = Create_Transform();
	Compose_Transforms(Object->UV_Trans, Trans);

  Transform_Interior(Object->Interior, Trans);

  Translate(Object, Vector, Trans);
}