当前位置: 首页>>代码示例>>C++>>正文


C++ MATRIX::SetOTMatrix方法代码示例

本文整理汇总了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);
}
开发者ID:Kalamatee,项目名称:RayStorm,代码行数:36,代码来源:texture.cpp

示例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);
}
开发者ID:Kalamatee,项目名称:RayStorm,代码行数:98,代码来源:brush.cpp


注:本文中的MATRIX::SetOTMatrix方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。