本文整理汇总了C++中MATRIX::MultVectMat方法的典型用法代码示例。如果您正苦于以下问题:C++ MATRIX::MultVectMat方法的具体用法?C++ MATRIX::MultVectMat怎么用?C++ MATRIX::MultVectMat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MATRIX
的用法示例。
在下文中一共展示了MATRIX::MultVectMat方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/*************
* DESCRIPTION: convert rscn version 100 brushes and textures
* INPUT: root surface root object
* OUTPUT: -
*************/
void SURFACE::ConvertV100(OBJECT *root)
{
BRUSH_OBJECT *brush;
TEXTURE_OBJECT *texture;
VECTOR ox,oy,oz;
MATRIX m;
InvOrient(&root->orient_x, &root->orient_y, &root->orient_z, &ox, &oy, &oz);
m.SetOMatrix(&ox,&oy,&oz);
brush = root->brush;
while(brush)
{
VecSub(&brush->pos, &root->pos, &brush->pos);
m.MultVectMat(&brush->orient_x);
m.MultVectMat(&brush->orient_y);
m.MultVectMat(&brush->orient_z);
brush = (BRUSH_OBJECT*)brush->GetNext();
}
texture = root->texture;
while(texture)
{
VecSub(&texture->pos, &root->pos, &texture->pos);
m.MultVectMat(&texture->orient_x);
m.MultVectMat(&texture->orient_y);
m.MultVectMat(&texture->orient_z);
texture = (TEXTURE_OBJECT*)texture->GetNext();
}
}
示例2: SetObject
/*************
* DESCRIPTION: sets the new object specs
* INPUT: disp pointer to display structure
* pos translate factor
* ox,oy,oz rotate factor
* size scale factor
* OUTPUT: none
*************/
void CAMERA::SetObject(DISPLAY *disp, VECTOR *pos, VECTOR *ox, VECTOR *oy, VECTOR *oz, VECTOR *size)
{
MATRIX m;
if(disp)
{
if(disp->view->viewmode == VIEW_CAMERA)
{
VecAdd(pos,&this->pos,&disp->view->pos);
if(!track)
{
InvOrient(ox, oy, oz, &disp->view->axis_x, &disp->view->axis_y, &disp->view->axis_z);
m.SetOMatrix(&orient_x,&orient_y,&orient_z);
m.MultVectMat(&disp->view->axis_x);
m.MultVectMat(&disp->view->axis_y);
m.MultVectMat(&disp->view->axis_z);
}
else
{
UpdateTracking(&disp->view->pos);
InvOrient(&orient_x, &orient_y, &orient_z, &disp->view->axis_x, &disp->view->axis_y, &disp->view->axis_z);
}
}
}
SetVector(&bboxmin, -this->size.z*.5f, -this->size.z*.5f, -this->size.z);
SetVector(&bboxmax, this->size.z*.5f, this->size.z*1.3f, this->size.z*1.5f);
}
示例3: CalcOrient
/*************
* DESCRIPTION: Calculate with three angles three vectors such that all are
* mutually perpendicular. The vectors are normalized
* INPUT: align alignment
* orient result vectors
* OUTPUT: none
*************/
void CalcOrient(VECTOR *align, VECTOR *orient_x, VECTOR *orient_y, VECTOR *orient_z)
{
MATRIX matrix;
matrix.SetRotMatrix(align);
// x-orientation
SetVector(orient_x, 1.f, 0.f, 0.f);
matrix.MultVectMat(orient_x);
// y-orientation
SetVector(orient_y, 0.f, 1.f, 0.f);
matrix.MultVectMat(orient_y);
// z-orientation
SetVector(orient_z, 0.f, 0.f, 1.f);
matrix.MultVectMat(orient_z);
}
示例4: Update
/*************
* DESCRIPTION: Update texture parameters
* INPUT: time actual time
* OUTPUT: none
*************/
void TEXTURE::Update(const float time)
{
TIME t;
MATRIX r;
if((actor->time.begin != this->time) || (actor->time.end != time))
{
t.begin = this->time;
t.end = time;
actor->Animate(&t);
}
actor->matrix->MultVectMat(&pos);
actor->rotmatrix->InvMat(&r);
r.MultVectMat(&orient_x);
r.MultVectMat(&orient_y);
r.MultVectMat(&orient_z);
this->time = time;
}