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


C++ ofNode类代码示例

本文整理汇总了C++中ofNode的典型用法代码示例。如果您正苦于以下问题:C++ ofNode类的具体用法?C++ ofNode怎么用?C++ ofNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ofNode类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setParent

//----------------------------------------
void ofNode::setParent(ofNode& parent, bool bMaintainGlobalTransform) {
    if(bMaintainGlobalTransform) {
		ofMatrix4x4 postParentGlobalTransform = getGlobalTransformMatrix() * parent.getGlobalTransformMatrix().getInverse();
		parent.addListener(*this);
		setTransformMatrix(postParentGlobalTransform);
	} else {
		parent.addListener(*this);
	}
	this->parent = &parent;
}
开发者ID:Laudanum,项目名称:openFrameworks,代码行数:11,代码来源:ofNode.cpp

示例2: addPointsToMesh

void gradientWaves::addPointsToMesh(ofMesh *m, ofNode l, ofNode r, int i){
    ofFloatColor col = ofColor::white;
    
    float mix = cos(i*3);
    ofFloatColor temp = ofColor::lightGreen;
    ofFloatColor temp2 = ofColor::darkMagenta;
    
    m->addVertex(l.getGlobalPosition());
    m->addColor(col);
    m->addVertex(r.getGlobalPosition());
    
    m->addColor(col);
}
开发者ID:ofZach,项目名称:funkyForms,代码行数:13,代码来源:gradientWaves.cpp

示例3: setParent

//----------------------------------------
void ofNode::setParent(ofNode& parent, bool bMaintainGlobalTransform) {
	if (this->parent)
	{
		// we need to make sure to clear before
		// re-assigning parenthood.
		clearParent(bMaintainGlobalTransform);
	}
	if(bMaintainGlobalTransform) {
		auto postParentGlobalTransform = glm::inverse(parent.getGlobalTransformMatrix()) * getGlobalTransformMatrix();
		parent.addListener(*this);
		setTransformMatrix(postParentGlobalTransform);
	} else {
		parent.addListener(*this);
	}
	this->parent = &parent;
}
开发者ID:IglooVision,项目名称:openFrameworks,代码行数:17,代码来源:ofNode.cpp

示例4: aiMatrix4x4ToOfMatrix4x4

//--------------------------------------------------------------
static void aiMatrix4x4ToOfMatrix4x4(const aiMatrix4x4& aim, ofNode& ofm){
	float m[16] = { aim.a1,aim.a2,aim.a3,aim.a4,
					aim.b1,aim.b2,aim.b3,aim.b4,
					aim.c1,aim.c2,aim.c3,aim.c4,
					aim.d1,aim.d2,aim.d3,aim.d4 };

	ofm.setTransformMatrix(	m);
}
开发者ID:6301158,项目名称:openFrameworks_0.071_debian_package,代码行数:9,代码来源:ofxAssimpModelLoader.cpp

示例5: setParent

//----------------------------------------
void ofNode::setParent(ofNode& parent, bool bMaintainGlobalTransform) {
	if (this->parent)
	{
		// we need to make sure to clear before
		// re-assigning parenthood.
		clearParent(bMaintainGlobalTransform);
	}
	if(bMaintainGlobalTransform) {
		auto postParentPosition = position - parent.getGlobalPosition();
		auto postParentOrientation = orientation.get() * glm::inverse(parent.getGlobalOrientation());
		auto postParentScale = scale / parent.getGlobalScale();
		parent.addListener(*this);
		setOrientation(postParentOrientation);
		setPosition(postParentPosition);
		setScale(postParentScale);
	} else {
		parent.addListener(*this);
	}
	this->parent = &parent;
}
开发者ID:Catchoom,项目名称:openFrameworks,代码行数:21,代码来源:ofNode.cpp

示例6: update

void RibbonSegment::update(ofNode inFront)
{
    //damply move towards the front;
    ofVec3f newPosition = node.getPosition() + (inFront.getPosition() - node.getPosition()) * .1;
    
    //almost there...
    node.setPosition( newPosition );
    
    //stay on target
    node.lookAt(inFront, node.getUpDir());
    
}
开发者ID:imclab,项目名称:24HourMusic,代码行数:12,代码来源:RibbonSegment.cpp

示例7: draw

void ofCairoRenderer::draw(const ofNode& node) const{
	const_cast<ofCairoRenderer*>(this)->pushMatrix();
	const_cast<ofCairoRenderer*>(this)->multMatrix(node.getGlobalTransformMatrix());
	node.customDraw(this);
	const_cast<ofCairoRenderer*>(this)->popMatrix();
}
开发者ID:8morikazuto,项目名称:openFrameworks,代码行数:6,代码来源:ofCairoRenderer.cpp

示例8: orbitRad

//----------------------------------------
void ofNode::orbitRad(float longitude, float latitude, float radius, ofNode& centerNode) {
	orbitRad(longitude, latitude, radius, centerNode.getGlobalPosition());
}
开发者ID:Catchoom,项目名称:openFrameworks,代码行数:4,代码来源:ofNode.cpp

示例9: lookAt

//----------------------------------------
void ofNode::lookAt(const ofNode& lookAtNode, const glm::vec3& upVector) {
	lookAt(lookAtNode.getGlobalPosition(), upVector);
}
开发者ID:Catchoom,项目名称:openFrameworks,代码行数:4,代码来源:ofNode.cpp

示例10: ofxResetTransform

void ofxResetTransform(ofNode &node) {
    node.resetTransform();
    node.setScale(1,1,1);
}
开发者ID:Bicicletorama,项目名称:Game,代码行数:4,代码来源:ofxExtras.cpp

示例11: ofxRotate

void ofxRotate(ofNode &node, ofQuaternion q) {
    node.setOrientation(node.getOrientationQuat() * q);
}
开发者ID:Bicicletorama,项目名称:Game,代码行数:3,代码来源:ofxExtras.cpp


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