本文整理汇总了C++中setOrigin函数的典型用法代码示例。如果您正苦于以下问题:C++ setOrigin函数的具体用法?C++ setOrigin怎么用?C++ setOrigin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setOrigin函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setOrigin
void ENUTracker::reset(const Vector3& pos) {
quickCounter = 2500;
#ifndef USE_SINGLE__PRECISION_NUMBERS
setOrigin(pos.x);
#else
double x[3];
x[0] = pos[0]; x[1] = pos[1]; x[2] = pos[2];
setOrigin(x);
#endif
lastPosition = pos;
}
示例2: setOrigin
/*!
\property QGeoMapPolygonObject::path
\brief This property holds the ordered list of coordinates which define the
polygon to be drawn by this polygon object.
The default value of this property is an empty list of coordinates.
The coordinates should be listed in the order in which they would be
traversed when traveling around the border of the polygon.
Invalid coordinates in the list will be ignored, and if the list of
coordinates contains less than 3 valid coordinates then the polygon object
will not be displayed.
\since 1.1
*/
void QGeoMapPolygonObject::setPath(const QList<QGeoCoordinate> &path)
{
if (d_ptr->path != path) {
d_ptr->path = path;
if (path.size() != 0)
setOrigin(path.at(0));
else
setOrigin(QGeoCoordinate());
emit pathChanged(emit d_ptr->path);
}
}
示例3: d_ptr
/*!
Constructs a new pixmap object which will draw the pixmap \a pixmap at an
offset of \a offset pixels from the coordinate \a coordinate.
*/
QGeoMapPixmapObject::QGeoMapPixmapObject(const QGeoCoordinate &coordinate, const QPoint &offset, const QPixmap &pixmap)
: d_ptr(new QGeoMapPixmapObjectPrivate())
{
setOrigin(coordinate);
d_ptr->pixmap = pixmap;
d_ptr->offset = offset;
}
示例4: KeyText
KeyText(const std::string& str, const sf::Font& f, float timeDuration, int l, float t)
:sf::Text(str, f), duration(timeDuration), limb(l), timeCreated(t)
{
sf::FloatRect textRect =getLocalBounds();
setOrigin(textRect.left + textRect.width/2.0f,
textRect.top + textRect.height/2.0f);
}
示例5: setOrigin
int PCBNEW_CONTROL::GridSetOrigin( const TOOL_EVENT& aEvent )
{
VECTOR2D* origin = aEvent.Parameter<VECTOR2D*>();
if( origin )
{
setOrigin( getView(), m_frame, m_gridOrigin, *origin );
delete origin;
}
else
{
Activate();
PICKER_TOOL* picker = m_toolMgr->GetTool<PICKER_TOOL>();
assert( picker );
// TODO it will not check the toolbar button in module editor, as it uses a different ID..
m_frame->SetToolID( ID_PCB_PLACE_GRID_COORD_BUTT, wxCURSOR_PENCIL, _( "Adjust grid origin" ) );
picker->SetClickHandler( boost::bind( setOrigin, getView(), m_frame, m_gridOrigin, _1 ) );
picker->Activate();
Wait();
}
return 0;
}
示例6: Agent
Agent(int v, Cell& c1, Cell& c2, float speed = 1.f) : AnimatedElement(Texture("grid.png"), sf::Vector2f(), 0.f, 64, 1, GameStep::player->getStyle()*8 ), c2(c2)
{
setOrigin(32, 32);
setScale(.5f, .5f);
delta = c2.getPosition() - c1.getPosition();
float length = sqrt( delta.x * delta.x + delta.y * delta.y );
delta /= length;
sf::Vector2f startPos = c1.getPosition() + delta*c1.getRadius();
sf::Vector2f endPos = c2.getPosition() - delta*c2.getRadius();
setPosition(startPos);
sf::Vector2f travel = endPos - startPos;
length = sqrt( travel.x*travel.x + travel.y*travel.y );
value = c1.sendValue(v);
//speed *= (value < 0 ? 1.f : .5f);
delta *= speed;
duration = length/speed;
elapsed = 0;
if(value != 0) alive = true; else setColor(sf::Color::Transparent);
if(value < 0) sprite.setTextureRect(sf::IntRect(0, 196, 64, 64));
}
示例7: updating
void SPlaneSlicer::updating()
{
this->setReslicerExtent();
this->setReslicerAxes();
auto image = this->getInput< ::fwData::Image >(s_IMAGE_IN);
vtkSmartPointer<vtkImageData> vtkimg = vtkSmartPointer<vtkImageData>::New();
::fwVtkIO::toVTKImage(image, vtkimg.Get());
m_reslicer->SetInputData(vtkimg);
m_reslicer->Update();
auto slice = this->getInOut< ::fwData::Image >(s_SLICE_OUT);
::fwVtkIO::fromVTKImage(m_reslicer->GetOutput(), slice);
// HACK: Make output slice three-dimensional.
// We need to do so in order to visualize it with ::visuVTKAdaptor::SImageSlice.
// This is because the adaptor uses a vtkImageActor which doesn't handle 2d images.
auto size = slice->getSize();
slice->setSize({{size[0], size[1], 1}});
auto spacing = slice->getSpacing();
slice->setSpacing({{spacing[0], spacing[1], 0 }});
auto origin = slice->getOrigin();
slice->setOrigin({{origin[0], origin[1], 0}});
auto sig = slice->signal< ::fwData::Image::ModifiedSignalType >(::fwData::Image::s_MODIFIED_SIG);
sig->asyncEmit();
}
示例8: clearScreen
/**
* Clear the display and print the string s starting from (0,0)
* @param s The string to be printed
*/
void LCD5110::printStr(String s){
clearScreen();
setOrigin();
sendStr(s);
}
示例9: setOrigin
// virtual
void LLFloaterObjectWeights::onOpen()
{
const LLRect& tools_rect = gFloaterTools->getRect();
setOrigin(tools_rect.mRight, tools_rect.mTop - getRect().getHeight());
refresh();
updateLandImpacts(LLViewerParcelMgr::getInstance()->getFloatingParcelSelection()->getParcel());
}
示例10: getOrigin
void Camera::moveUpDiscrete() {
Vector3 origin = getOrigin();
origin[2] += SPEED_MOVE;
setOrigin(origin);
}
示例11: generate_shape
// Just for testing
static void generate_shape(EntityManager* em, float x = 4.f, float y = 1.f) {
auto entity = em->create_entity();
auto shape = new sf::CircleShape(1.0f);
shape->setFillColor(sf::Color::Red);
shape->setOrigin(1.0f, 1.0f);
b2BodyDef body_def;
body_def.position = b2Vec2(x, y);
body_def.type = b2_dynamicBody;
b2CircleShape body_shape;
body_shape.m_p.Set(0.0f, 0.0f);
body_shape.m_radius = 1.0f;
b2FixtureDef fixture;
fixture.density = 1.f;
fixture.friction = 0.7f;
fixture.shape = &body_shape;
fixture.restitution = 0.1f;
entity.add_component<rh::components::Renderable>(shape);
entity.add_component<rh::components::Transformable>(shape);
entity.add_component<rh::components::Physics>(body_def, fixture);
entities.push_back(entity.id());
}
示例12: setOrigin
void Entity::EventSetSize( Event *ev )
{
mins = ev->GetVector( 1 );
maxs = ev->GetVector( 2 );
setOrigin( origin );
}
示例13: setOrigin
LaserSource::LaserSource(char col)
{
setOrigin(BLOCK_SIZE/2, BLOCK_SIZE/2);
switch(col)
{
case 'r':
{
label = '1';
color = sf::Color::Red;
setTexture(LaserSource::redTexture);
break;
}
case 'b':
{
label = 'j';
color = sf::Color::Blue;
setTexture(LaserSource::blueTexture);
break;
}
default:
{
label = '1';
color = sf::Color::Red;
setTexture(LaserSource::redTexture);
break;
}
}
}
示例14: setTexture
void Personnage::AjustementsVisuels()
{
setTexture(textureIddle);
intRectsImmobile = new IntRect*[NBR_NIVEAUX];
intRectsMouvement = new IntRect*[NBR_NIVEAUX];
intRectsAttaque = new IntRect*[NBR_NIVEAUX];
for (int i = 0; i < NBR_NIVEAUX; i++)
{
intRectsImmobile[i] = new IntRect[NBR_ANIMS_IMMOBILE];
int largeur = textureIddle.getSize().x / NBR_ANIMS_IMMOBILE;
int hauteur = textureIddle.getSize().y / NBR_NIVEAUX;
for (int j = 0; j < NBR_ANIMS_IMMOBILE; j++)
{
intRectsImmobile[i][j].left = largeur * j;
intRectsImmobile[i][j].top = hauteur * i;
intRectsImmobile[i][j].width = largeur;
intRectsImmobile[i][j].height = hauteur;
}
}
for (int i = 0; i < NBR_NIVEAUX; i++)
{
intRectsMouvement[i] = new IntRect[NBR_ANIMS_MOUVEMENT];
int largeur = textureMove.getSize().x / NBR_ANIMS_MOUVEMENT;
int hauteur = textureMove.getSize().y / NBR_NIVEAUX;
for (int j = 0; j < NBR_ANIMS_MOUVEMENT; j++)
{
intRectsMouvement[i][j].left = largeur * j;
intRectsMouvement[i][j].top = hauteur * i;
intRectsMouvement[i][j].width = largeur;
intRectsMouvement[i][j].height = hauteur;
}
}
for (int i = 0; i < NBR_NIVEAUX; i++)
{
intRectsAttaque[i] = new IntRect[NBR_ANIMS_ATTAQUE];
int largeur = textureAttaque.getSize().x / NBR_ANIMS_ATTAQUE;
int hauteur = textureAttaque.getSize().y / NBR_NIVEAUX;
for (int j = 0; j < NBR_ANIMS_ATTAQUE; j++)
{
intRectsAttaque[i][j].left = largeur * j;
intRectsAttaque[i][j].top = hauteur * i;
intRectsAttaque[i][j].width = largeur;
intRectsAttaque[i][j].height = hauteur;
}
}
setTextureRect(intRectsImmobile[cadran][0]);
setOrigin(intRectsImmobile[0][0].height / 2, intRectsImmobile[0][0].width / 2);
}
示例15: setOrigin
ofxCamera::ofxCamera(){
setOrigin(OF_ORIGIN);
perspective();
position();
eye();
up();
}