VERY quick question (What is setH/setP?) (Solved)

I was at a loss trying to go solely on the documentation to implement a mouselook in my FPSMMORPG that I’m making. Anywho, I looked about and found tree’s FPS script here:

I am trying to understand and implement a similar situation, so firstly I tried using his code in a task on my game. It snaps the mouse to the center of the screen, letting it move enough to capture data, but the screen doesnt move about (if it does, it is sporatic and stuck in a direction). Anyway, to troubleshoot I need to understand the code.

Here’s what’s on my task:

	def mouselook(self,task):
		#Get Mouse X & Y
		#Move Screen based on Mouse X & Y
		return Task.cont

I need to know two things: What is setH/getH, and what is setP/getP? I was unable to find documentation on these functions. What I assume is that they are undocumented abbreviations for something like Hpr and Pos, but I am only guessing. If anyone could answer me that and/or tell me why this code doesn’t work, It’d be much appreciated.

HPR stands for Heading, Pitch, and Roll. You can set or get all three at once with setHpr()/getHpr(), or you can set or get the individual components with setH()/getH(), setP()/getP(), and setR()/getR().

A similar overall vs. componentwise interface exists for setPos()/getPos() vs. setX, setY, and setZ.

By fiddling with setP and setH, the code is attempting to rotate the camera vertically and horizontally.


Thank you so much, such a simple thing but baffling if you simply weren’t aware of it, lol!

Note that this is also explained at this manual page:
That page also lists other useful functions.