BOOL CXaraFileRectangle::WriteRectangleComplex(BaseCamelotFilter * pFilter, NodeRegularShape * pShape) { BOOL ok; CamelotFileRecord Rec(pFilter,TAG_RECTANGLE_COMPLEX, TAG_RECTANGLE_COMPLEX_SIZE); ok = Rec.Init(); if (ok) ok = Rec.WriteCoord(GetCentrePoint(pShape)); if (ok) ok = Rec.WriteCoordTrans(GetMajorAxis(pShape),0,0); if (ok) ok = Rec.WriteCoordTrans(GetMinorAxis(pShape),0,0); if (ok) ok = pFilter->Write(&Rec); return ok; }
BOOL CXaraFilePolygon::WritePolygonComplex(BaseCamelotFilter * pFilter, NodeRegularShape * pShape) { BOOL ok; CamelotFileRecord Rec(pFilter,TAG_POLYGON_COMPLEX, TAG_POLYGON_COMPLEX_SIZE); ok = Rec.Init(); if (ok) ok = Rec.WriteUINT16(GetNumberOfSides(pShape)); if (ok) ok = Rec.WriteCoord(GetCentrePoint(pShape)); if (ok) ok = Rec.WriteCoordTrans(GetMajorAxis(pShape),0,0); if (ok) ok = Rec.WriteCoordTrans(GetMinorAxis(pShape),0,0); if (ok) ok = pFilter->Write(&Rec); return ok; }
BOOL CXaraFileRectangle::WriteRectangleComplexStellated(BaseCamelotFilter * pFilter, NodeRegularShape * pShape) { BOOL ok; CamelotFileRecord Rec(pFilter,TAG_RECTANGLE_COMPLEX_STELLATED, TAG_RECTANGLE_COMPLEX_STELLATED_SIZE); ok = Rec.Init(); if (ok) ok = Rec.WriteCoord(GetCentrePoint(pShape)); if (ok) ok = Rec.WriteCoordTrans(GetMajorAxis(pShape),0,0); if (ok) ok = Rec.WriteCoordTrans(GetMinorAxis(pShape),0,0); if (ok) ok = Rec.WriteDOUBLE(GetStellationRadius(pShape)); if (ok) ok = Rec.WriteDOUBLE(GetStellationOffset(pShape)); if (ok) ok = pFilter->Write(&Rec); return ok; }
void UTexAlignerPlanar::AlignSurf( ETexAlign InTexAlignType, UModel* InModel, FBspSurfIdx* InSurfIdx, FPoly* InPoly, FVector* InNormal ) { if( InTexAlignType == TEXALIGN_PlanarAuto ) TAxis = TAXIS_AUTO; else if( InTexAlignType == TEXALIGN_PlanarWall ) TAxis = TAXIS_WALLS; else if( InTexAlignType == TEXALIGN_PlanarFloor ) TAxis = TAXIS_Z; int32 Axis = GetMajorAxis( *InNormal, TAxis ); if( TAxis != TAXIS_AUTO && TAxis != TAXIS_WALLS ) Axis = TAxis; bool bFlip = ShouldFlipVectors( *InNormal, Axis ); // Determine the texturing vectors. FVector U, V; if( Axis == TAXIS_X ) { U = FVector(0, (bFlip ? 1 : -1) ,0); V = FVector(0,0,-1); } else if( Axis == TAXIS_Y ) { U = FVector((bFlip ? -1 : 1),0,0); V = FVector(0,0,-1); } else { U = FVector((bFlip ? 1 : -1),0,0); V = FVector(0,-1,0); } FVector Base = FVector::ZeroVector; U *= UTile; V *= VTile; InSurfIdx->Surf->pBase = FBSPOps::bspAddPoint(InModel,&Base,0); InSurfIdx->Surf->vTextureU = FBSPOps::bspAddVector( InModel, &U, 0); InSurfIdx->Surf->vTextureV = FBSPOps::bspAddVector( InModel, &V, 0); }
BOOL CXaraFilePolygon::WritePolygonComplexRoundedStellated(BaseCamelotFilter * pFilter, NodeRegularShape * pShape) { BOOL ok; CamelotFileRecord Rec(pFilter,TAG_POLYGON_COMPLEX_ROUNDED_STELLATED, TAG_POLYGON_COMPLEX_ROUNDED_STELLATED_SIZE); ok = Rec.Init(); if (ok) ok = Rec.WriteUINT16(GetNumberOfSides(pShape)); if (ok) ok = Rec.WriteCoord(GetCentrePoint(pShape)); if (ok) ok = Rec.WriteCoordTrans(GetMajorAxis(pShape),0,0); if (ok) ok = Rec.WriteCoordTrans(GetMinorAxis(pShape),0,0); if (ok) ok = Rec.WriteDOUBLE(GetStellationRadius(pShape)); if (ok) ok = Rec.WriteDOUBLE(GetStellationOffset(pShape)); if (ok) ok = Rec.WriteDOUBLE(GetPrimaryCurvature(pShape)); if (ok) ok = Rec.WriteDOUBLE(GetSecondaryCurvature(pShape)); if (ok) ok = pFilter->Write(&Rec); return ok; }