|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Using POV in Java
I am relatively new to programming and still have a lot to learn. I found some code on an old post on Chief Delphi and I added a class and added that in but it says: public class POV implements IControl. I am wondering what it means by implementing IControl and what is IControl and how to I implement it in my code. All help is gratefully appreciated
![]() |
|
#2
|
||||
|
||||
|
Re: Using POV in Java
Can you link the CD post?
|
|
#3
|
||||
|
||||
|
Re: Using POV in Java
|
|
#4
|
||||
|
||||
|
Re: Using POV in Java
Yeah, just use the getPOV() method of your joystick object. It's not hard to check this angle against constants to determine which direction is pressed.
|
|
#5
|
||||
|
||||
|
Re: Using POV in Java
Java background - The "implements" keyword indicates that the class named POV has a required set of interface functions defined by the interface IControl. IControl effectively puts requirements on what sorts of functionality the POV class must provide. http://stackoverflow.com/questions/4...-do-on-a-class has a pretty good example.
As already mentioned, Joystick.getPOV() is probably the right answer, making the above statement relevant only for your edification. As an example somewhat related to what you were doing, here's code our students wrote last year specific to an XBOX 360 controller, where we determine which direction(s) the POV hat is pushed based on angle criteria: https://github.com/RobotCasserole173...ontroller.java Last edited by gerthworm : 30-11-2016 at 13:24. |
|
#6
|
||||
|
||||
|
Re: Using POV in Java
What exactly are you trying to do?
IControl is an interface, I assume for controllers. I've never seen it before, and unless you are implementing some custom control interface, I don't think you need it. Just googling it, I found a Github repo from 3128 with class POV implementing IControl. IControl is a file in that same repo, and should be distributed along with POV. I think you're putting the cart before the horse, if it were. There is probably a better way to do what you're trying to do. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|