The SET_VIEW() macro will allow you to change the player's view to another entity. For example...
SET_VIEW(pPlayer->edict(), pSmashCam->edict());
...will change the player's view to view from the SmashCam entity (assuming you've set the pPlayer and pSmashCam to the Player entity and SmashCam entity before this).
Calling SET_VIEW() with the player edict for both parameters will set the player's camera back to within their own head, i.e....
SET_VIEW(pPlayer->edict(), pPlayer->edict());
Alright, I have the basics going, but I'm running into a few problems... perhaps you can help me. When I hit the impulse, a couple odd things happen. The first is that I'm not getting the viewpoint of the info_smash_cam, rather, the viewpoint is from on the floor of my map in the corner (the smash_cam is way up in the air). The other oddity is that when the camera is activated, and the view switches, the new view is "smaller", that is, the view window takes up about 1/4 of my screen, as opposed to the full screen resolution, with HOM effect around the other 3/4 of the screen.
----- |#| | | | -----
The # is the limit of the "new" view, which is strange.
Here's what I have so far:
The smashcam spawn, copied from the InfoIntermission. I'm probably not setting things correctly.
void CSmashCam::Spawn(void)
{
UTIL_SetOrigin( pev, pev->origin );
pev->solid = SOLID_NOT;
pev->effects = EF_NODRAW;
}Here's the code which actually switches the viewpoint:
void CBasePlayer :: SmashCamView() { CPointEntity *pSmashCam;
if (!m_bInSmashCam) {
// TODO: only one smashcam for now, support for multiple?
pSmashCam = (CPointEntity *)UTIL_FindEntityByClassname(NULL,
"info_smash_cam");
ALERT( at_console, "The smashcam's origin is %lf, %lf, %lf\n",
pSmashCam->pev->origin.x, pSmashCam->pev->origin.y,
pSmashCam->pev->origin.z);
ALERT( at_console, "Your origin is %lf, %lf, %lf\n", pev->origin.x,
pev->origin.y, pev->origin.z); SET_VIEW(ENT(pev), pSmashCam->edict());
m_bInSmashCam = true;
} else {
SET_VIEW(this->edict(), this->edict());
m_bInSmashCam = false;
}
}Again, sorry for the newbiness of this all, the SDK is a bit confusing, but I think I'm getting a handle on it.
Regards,
Tony
_______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders

