suggested fixes
This commit is contained in:
parent
81de0e0cbd
commit
2c8cce4655
@ -1404,7 +1404,8 @@ CCamera::SetRwCamera(RwCamera *cam)
|
|||||||
CMBlur::MotionBlurOpen(m_pRwCamera);
|
CMBlur::MotionBlurOpen(m_pRwCamera);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 CCamera::GetCutSceneFinishTime(void)
|
uint32
|
||||||
|
CCamera::GetCutSceneFinishTime(void)
|
||||||
{
|
{
|
||||||
int cam = ActiveCam;
|
int cam = ActiveCam;
|
||||||
if (Cams[cam].Mode == CCam::MODE_FLYBY)
|
if (Cams[cam].Mode == CCam::MODE_FLYBY)
|
||||||
|
@ -161,12 +161,11 @@ bool
|
|||||||
CPedIK::LookInDirection(float phi, float theta)
|
CPedIK::LookInDirection(float phi, float theta)
|
||||||
{
|
{
|
||||||
bool success = true;
|
bool success = true;
|
||||||
AnimBlendFrameData *frameData = m_ped->m_pFrames[PED_HEAD];
|
RwFrame *frame = m_ped->GetNodeFrame(PED_HEAD);
|
||||||
RwFrame *frame = frameData->frame;
|
|
||||||
RwMatrix *frameMat = RwFrameGetMatrix(frame);
|
RwMatrix *frameMat = RwFrameGetMatrix(frame);
|
||||||
|
|
||||||
if (!(frameData->flag & AnimBlendFrameData::IGNORE_ROTATION)) {
|
if (!(m_ped->m_pFrames[PED_HEAD]->flag & AnimBlendFrameData::IGNORE_ROTATION)) {
|
||||||
frameData->flag |= AnimBlendFrameData::IGNORE_ROTATION;
|
m_ped->m_pFrames[PED_HEAD]->flag |= AnimBlendFrameData::IGNORE_ROTATION;
|
||||||
CPedIK::ExtractYawAndPitchLocal(frameMat, &m_headOrient.phi, &m_headOrient.theta);
|
CPedIK::ExtractYawAndPitchLocal(frameMat, &m_headOrient.phi, &m_headOrient.theta);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -223,19 +222,19 @@ bool
|
|||||||
CPedIK::PointGunInDirection(float phi, float theta)
|
CPedIK::PointGunInDirection(float phi, float theta)
|
||||||
{
|
{
|
||||||
bool result = true;
|
bool result = true;
|
||||||
bool b1 = false;
|
bool armPointedToGun = false;
|
||||||
float angle = CGeneral::LimitRadianAngle(phi - m_ped->m_fRotationCur);
|
float angle = CGeneral::LimitRadianAngle(phi - m_ped->m_fRotationCur);
|
||||||
m_flags &= (~FLAG_1);
|
m_flags &= (~FLAG_1);
|
||||||
m_flags |= LOOKING;
|
m_flags |= LOOKING;
|
||||||
if (m_flags & AIMS_WITH_ARM) {
|
if (m_flags & AIMS_WITH_ARM) {
|
||||||
b1 = PointGunInDirectionUsingArm(angle, theta);
|
armPointedToGun = PointGunInDirectionUsingArm(angle, theta);
|
||||||
angle = CGeneral::LimitRadianAngle(angle - m_upperArmOrient.phi);
|
angle = CGeneral::LimitRadianAngle(angle - m_upperArmOrient.phi);
|
||||||
}
|
}
|
||||||
if (b1) {
|
if (armPointedToGun) {
|
||||||
if (m_flags & AIMS_WITH_ARM && m_torsoOrient.phi * m_upperArmOrient.phi < 0.0f)
|
if (m_flags & AIMS_WITH_ARM && m_torsoOrient.phi * m_upperArmOrient.phi < 0.0f)
|
||||||
MoveLimb(m_torsoOrient, 0.0f, m_torsoOrient.theta, ms_torsoInfo);
|
MoveLimb(m_torsoOrient, 0.0f, m_torsoOrient.theta, ms_torsoInfo);
|
||||||
} else {
|
} else {
|
||||||
RwMatrix *matrix = GetWorldMatrix(RwFrameGetParent(m_ped->m_pFrames[PED_UPPERARMR]->frame), RwMatrixCreate());
|
RwMatrix *matrix = GetWorldMatrix(RwFrameGetParent(m_ped->GetNodeFrame(PED_UPPERARMR)), RwMatrixCreate());
|
||||||
float yaw, pitch;
|
float yaw, pitch;
|
||||||
ExtractYawAndPitchWorld(matrix, &yaw, &pitch);
|
ExtractYawAndPitchWorld(matrix, &yaw, &pitch);
|
||||||
RwMatrixDestroy(matrix);
|
RwMatrixDestroy(matrix);
|
||||||
@ -256,7 +255,7 @@ bool
|
|||||||
CPedIK::PointGunInDirectionUsingArm(float phi, float theta)
|
CPedIK::PointGunInDirectionUsingArm(float phi, float theta)
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
RwFrame *frame = m_ped->m_pFrames[PED_UPPERARMR]->frame;
|
RwFrame *frame = m_ped->GetNodeFrame(PED_UPPERARMR);
|
||||||
RwMatrix *matrix = GetWorldMatrix(RwFrameGetParent(frame), RwMatrixCreate());
|
RwMatrix *matrix = GetWorldMatrix(RwFrameGetParent(frame), RwMatrixCreate());
|
||||||
|
|
||||||
RwV3d upVector = { matrix->right.z, matrix->up.z, matrix->at.z };
|
RwV3d upVector = { matrix->right.z, matrix->up.z, matrix->at.z };
|
||||||
@ -315,7 +314,7 @@ bool
|
|||||||
CPedIK::RestoreLookAt(void)
|
CPedIK::RestoreLookAt(void)
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
RwMatrix *mat = RwFrameGetMatrix(m_ped->m_pFrames[PED_HEAD]->frame);
|
RwMatrix *mat = RwFrameGetMatrix(m_ped->GetNodeFrame(PED_HEAD));
|
||||||
if (m_ped->m_pFrames[PED_HEAD]->flag & AnimBlendFrameData::IGNORE_ROTATION) {
|
if (m_ped->m_pFrames[PED_HEAD]->flag & AnimBlendFrameData::IGNORE_ROTATION) {
|
||||||
m_ped->m_pFrames[PED_HEAD]->flag &= (~AnimBlendFrameData::IGNORE_ROTATION);
|
m_ped->m_pFrames[PED_HEAD]->flag &= (~AnimBlendFrameData::IGNORE_ROTATION);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user