mirror of
https://github.com/zeldaret/tww.git
synced 2026-05-31 01:15:27 -04:00
JPAParticle work
This commit is contained in:
@@ -327,13 +327,13 @@ void JPADrawExecRotBillBoard::exec(const JPADrawContext* pDC, JPABaseParticle* p
|
||||
MTXMultVec(JPADrawContext::pcb->mDrawMtxPtr, pt, &pt);
|
||||
|
||||
GXBegin(GX_QUADS, GX_VTXFMT0, 4);
|
||||
GXPosition3f32((x0 * cos - y0 * sin) + pt.x, x0 + y0 + pt.y, pt.z);
|
||||
GXPosition3f32((x0 * cos - y0 * sin) + pt.x, (x0 * sin + y0 * cos) + pt.y, pt.z);
|
||||
GXTexCoord2f32(JPADrawContext::pcb->mTexCoordPt[0].x, JPADrawContext::pcb->mTexCoordPt[0].y);
|
||||
GXPosition3f32((x1 * cos - y0 * sin) + pt.x, y0 + x1 + pt.y, pt.z);
|
||||
GXPosition3f32((x1 * cos - y0 * sin) + pt.x, (x1 * sin + y0 * cos) + pt.y, pt.z);
|
||||
GXTexCoord2f32(JPADrawContext::pcb->mTexCoordPt[1].x, JPADrawContext::pcb->mTexCoordPt[1].y);
|
||||
GXPosition3f32((x1 * cos - y1 * sin) + pt.x, y1 + x1 + pt.y, pt.z);
|
||||
GXPosition3f32((x1 * cos - y1 * sin) + pt.x, (x1 * sin + y1 * cos) + pt.y, pt.z);
|
||||
GXTexCoord2f32(JPADrawContext::pcb->mTexCoordPt[2].x, JPADrawContext::pcb->mTexCoordPt[2].y);
|
||||
GXPosition3f32((x0 * cos - y1 * sin) + pt.x, y1 + x0 + pt.y, pt.z);
|
||||
GXPosition3f32((x0 * cos - y1 * sin) + pt.x, (x0 * sin + y1 * cos) + pt.y, pt.z);
|
||||
GXTexCoord2f32(JPADrawContext::pcb->mTexCoordPt[3].x, JPADrawContext::pcb->mTexCoordPt[3].y);
|
||||
GXEnd();
|
||||
}
|
||||
|
||||
@@ -38,19 +38,24 @@ void JPABaseParticle::initParticle() {
|
||||
else
|
||||
velAxis.zero();
|
||||
|
||||
velDir.zero();
|
||||
if (emtr->mInitialVelDir != 0.0f) {
|
||||
Mtx mtx;
|
||||
JPAGetYZRotateMtx(emtr->mSpread * emtr->getRandomSS(), emtr->getRandomSS(), mtx);
|
||||
JPAGetYZRotateMtx(emtr->mSpread * emtr->getRandomRF() * 32768.0f, emtr->getRandomSS(), mtx);
|
||||
MTXConcat(emtrInfo.mEmitterDirMtx, mtx, mtx);
|
||||
velDir.set(mtx[0][2], mtx[1][2], mtx[2][2]);
|
||||
velDir.scale(emtr->mInitialVelDir);
|
||||
} else {
|
||||
velDir.zero();
|
||||
}
|
||||
|
||||
velRndm.zero();
|
||||
if (emtr->mInitialVelRndm != 0.0f) {
|
||||
velRndm.set(emtr->getRandomSF(), emtr->getRandomSF(), emtr->getRandomSF());
|
||||
velRndm.scale(emtr->mInitialVelRndm);
|
||||
velRndm.set(
|
||||
emtr->mInitialVelRndm * emtr->getRandomSF(),
|
||||
emtr->mInitialVelRndm * emtr->getRandomSF(),
|
||||
emtr->mInitialVelRndm * emtr->getRandomSF()
|
||||
);
|
||||
} else {
|
||||
velRndm.zero();
|
||||
}
|
||||
|
||||
f32 velRatio = 1.0f + emtr->getRandomRF() * emtr->mInitialVelRatio;
|
||||
|
||||
Reference in New Issue
Block a user