How to let the object when the collision does not rotate

Two triangular collisions, how to set up to not rotate?
I am using the ofxBox2dPolygon.
The openframeworks version is 0.9.8 and ofxBox2d.

Please help me, thank you very much

Hello @SuperMoran, it is really difficult to help you because your question does not give enough information.
In general, when writing to the forum, try to explain:

  1. What you want to do.
  2. What have you done in order to achieve your goal (maybe with a snippet of your code).
  3. What it is not working as expected.

@edapx
English is not particularly good, please forgive my grammatical mistakes.
I now use the 0.9.8 version and ofxBox2d, add a triangle for collision processing.
The triangle does not rotate when the mouse drags the triangle movement, but I have not found a good solution.
This is my code:

ofPolyline shape;
ofxBox2d box2d;

vector<shared_ptr<ofxBox2dPolygon>> polyShapes;
vector<TriangleShape> triangle;
vector<vector<ofPoint>> drawImagePoints;

int nImageWidth, nImageHeight;
int nCountDownTime;
int nIntervals;

float nRandomMax, nRandomMin;
		
bool bGetTime;

ofVec2f floatRands[4];

void ofApp::setup(){
	ofSetVerticalSync(true);
	ofSetWindowShape(1920, 900);

	nImageHeight = nImageWidth = 200;
	nRandomMax = 0.05;
	nRandomMin = -0.05;
	nIntervals = 500;
	
	box2d.init();
	box2d.setGravity(0, 1);
	box2d.createBounds();
	box2d.setFPS(60.0);
	box2d.registerGrabbing();


	for (int i = 0; i < 4; i++) {
		images[i].load(ofToString(i) + ".png");
		images[i].resize(200, 200);
	}

	for (int i = 0; i < 4; i++) {
		triangle.push_back(TriangleShape());
		triangle[i].a = ofVec2f(nImageWidth + i * 300, nImageHeight);
		triangle[i].b = ofVec2f(i * 300, nImageHeight);
		triangle[i].c = ofVec2f(nImageWidth + i * 300, nImageHeight * 2);


		shared_ptr<ofxBox2dPolygon> poly = shared_ptr<ofxBox2dPolygon>(new ofxBox2dPolygon);
		poly.get()->addTriangle(triangle[i].a, triangle[i].b, triangle[i].c);
		poly.get()->setPhysics(1.0, 0.3, 0.3);
		poly->create(box2d.getWorld());
		polyShapes.push_back(poly);

	}
}

//--------------------------------------------------------------
void ofApp::update(){
	drawImagePoints.clear();
	vector<vector<ofPoint>>().swap(drawImagePoints);

	for (int i = 0; i < 4; i++) {
		
		if (bGetTime) {
			floatRands[i] = ofVec2f(ofRandom(nRandomMin, nRandomMax), ofRandom(nRandomMin, nRandomMax));
			if (i == 3) {
				bGetTime = false;
				nCountDownTime = ofGetElapsedTimeMillis();
			}
		}

		polyShapes[i]->setVelocity(floatRands[i]);
		drawImagePoints.push_back(polyShapes[i]->getPoints());
	}

	if (ofGetElapsedTimeMillis() - nCountDownTime >= nIntervals) {
		bGetTime = true;
	}

	box2d.update();
}

//--------------------------------------------------------------
void ofApp::draw(){
	box2d.drawGround();

	for (int i = 0; i < 4; i++) {
		polyShapes[i]->draw();
	}

}

I do not see any mouse events

box2d.registerGrabbing();Which contains the mouse listening events