本文整理汇总了C++中ofVec2f::getRotated方法的典型用法代码示例。如果您正苦于以下问题:C++ ofVec2f::getRotated方法的具体用法?C++ ofVec2f::getRotated怎么用?C++ ofVec2f::getRotated使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofVec2f
的用法示例。
在下文中一共展示了ofVec2f::getRotated方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ofColor
Confetti::Confetti(ofVec2f origin, ofVec2f velVector, float divergenceFactor, float tempStrengthVar, int tempId){
particleId = tempId;
color = ofColor(ofRandom(200),ofRandom(200),ofRandom(200));
//color = ofColor(255);
gravity = ofVec3f(0,1,0);
strengthVariation = tempStrengthVar;
externalForce = ofVec2f(0,0);
pos = ofVec3f(origin.x, origin.y, 0);
accel = velVector;
accel.z = ofRandom(-100,100);
divergence = velVector.getRotated(ofRandom(-divergenceFactor,divergenceFactor));
//vel = ofVec3f(velVector.x, velVector.y, velVector.x); // ASSIGNO X AL Z
vel = accel;
vel.x += divergence.x;
vel.y += divergence.y;
//vel.z += divergence.x;
strength = (ofRandom(1 - strengthVariation,1));
//strength = 1;
vel *= strength;
accel = 0;
rotation = ofRandom(360);
rotationStep = ofRandom(-10,10);
}