本文整理汇总了C++中MATRIX::SetOTMatrix方法的典型用法代码示例。如果您正苦于以下问题:C++ MATRIX::SetOTMatrix方法的具体用法?C++ MATRIX::SetOTMatrix怎么用?C++ MATRIX::SetOTMatrix使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MATRIX
的用法示例。
在下文中一共展示了MATRIX::SetOTMatrix方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ToRSI
/*************
* DESCRIPTION: transfer texture data to RayStorm Interface
* INPUT: surf current surface
* obj current object
* stack matrix stack
* OUTPUT: rsiERR_NONE if ok else error number
*************/
rsiResult TEXTURE_OBJECT::ToRSI(rsiCONTEXT *rc, void *surf, OBJECT *obj, MATRIX_STACK *stack)
{
rsiResult err;
void *texture;
VECTOR ox,oy,oz;
VECTOR orient_x, orient_y, orient_z, pos;
MATRIX m;
err = this->texture->ToRSI(rc, &texture, surf);
if(err)
return err;
m.SetOTMatrix(&this->orient_x,&this->orient_y,&this->orient_z, &this->pos);
stack->Push(&m);
stack->GenerateAxis(&orient_x, &orient_y, &orient_z, &pos);
stack->Pop();
InvOrient(&orient_x, &orient_y, &orient_z, &ox, &oy, &oz);
return PPC_STUB(rsiSetTexture)(CTXT, texture,
rsiTTexturePos, &pos,
rsiTTextureSize, &size,
rsiTTextureOrientX, &ox,
rsiTTextureOrientY, &oy,
rsiTTextureOrientZ, &oz,
rsiTDone);
}
示例2: ToRSI
/*************
* DESCRIPTION: transfer brush data to RayStorm Interface
* INPUT: surf current surface
* obj current object
* stack matrix stack
* OUTPUT: rsiERR_NONE if ok else error number
*************/
rsiResult BRUSH_OBJECT::ToRSI(rsiCONTEXT *rc, void *surf, OBJECT *obj, MATRIX_STACK *stack)
{
rsiResult err;
void *brush;
ULONG rsiflags=0;
VECTOR ox,oy,oz;
VECTOR orient_x, orient_y, orient_z, pos;
MATRIX m;
BOOL retry;
char buffer[256];
m.SetOTMatrix(&this->orient_x,&this->orient_y,&this->orient_z,&this->pos);
stack->Push(&m);
stack->GenerateAxis(&orient_x, &orient_y, &orient_z, &pos);
stack->Pop();
retry = FALSE;
do
{
err = PPC_STUB(rsiAddBrush)(CTXT, &brush, GetName(), surf);
if(err)
{
// can't load brush -> ask user for other filename
PPC_STUB(rsiGetErrorMsg)(CTXT, buffer, err);
retry = utility.AskRequest("Can't load brush '%s':\n%s\n\nDo you want to change the filename?", GetName(), buffer);
if(!retry)
return err;
else
{
strcpy(buffer, GetName());
retry = utility.FileRequ(buffer, FILEREQU_BRUSH, FILEREQU_INITIALFILEDIR);
if(retry)
SetName(buffer);
else
return err;
}
}
}
while(retry && err);
switch(this->brush->type)
{
case BRUSH_MAP_COLOR:
rsiflags |= rsiFBrushColor;
break;
case BRUSH_MAP_REFLECTIVITY:
rsiflags |= rsiFBrushReflectivity;
break;
case BRUSH_MAP_FILTER:
rsiflags |= rsiFBrushFilter;
break;
case BRUSH_MAP_ALTITUDE:
rsiflags |= rsiFBrushAltitude;
break;
case BRUSH_MAP_SPECULAR:
rsiflags |= rsiFBrushSpecular;
break;
}
switch(this->brush->wrap)
{
case BRUSH_WRAP_X:
rsiflags |= rsiFBrushWrapX;
break;
case BRUSH_WRAP_Y:
rsiflags |= rsiFBrushWrapY;
break;
case BRUSH_WRAP_XY:
rsiflags |= rsiFBrushWrapXY;
break;
}
if(this->brush->flags & BRUSH_SOFT)
rsiflags |= rsiFBrushSoft;
if(this->brush->flags & BRUSH_REPEAT)
rsiflags |= rsiFBrushRepeat;
if(this->brush->flags & BRUSH_MIRROR)
rsiflags |= rsiFBrushMirror;
InvOrient(&orient_x, &orient_y, &orient_z, &ox, &oy, &oz);
return PPC_STUB(rsiSetBrush)(CTXT, brush,
rsiTBrushFlags, rsiflags,
rsiTBrushPos, &pos,
rsiTBrushOrientX, &ox,
rsiTBrushOrientY, &oy,
rsiTBrushOrientZ, &oz,
rsiTBrushSize, &size,
rsiTDone);
}