Laser Sensing Display for UI interfaces in the real world

Dependencies:   mbed

Fork of skinGames_forktest by Alvaro Cassinelli

Committer:
mbedalvaro
Date:
Sun Sep 23 10:11:43 2012 +0000
Revision:
31:5f039cbddee8
this is quite nice, but  I am going to make a deep modification of the bouncing principle: instead of depending on the penetration, it will just be a factor over the speed (perfect elastic bouncing being factorElastic=1, and perfectly absorption=0);

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbedalvaro 31:5f039cbddee8 1
mbedalvaro 31:5f039cbddee8 2 /*
mbedalvaro 31:5f039cbddee8 3 Copyright (c) 2010 Donatien Garnier (donatiengar [at] gmail [dot] com)
mbedalvaro 31:5f039cbddee8 4
mbedalvaro 31:5f039cbddee8 5 Permission is hereby granted, free of charge, to any person obtaining a copy
mbedalvaro 31:5f039cbddee8 6 of this software and associated documentation files (the "Software"), to deal
mbedalvaro 31:5f039cbddee8 7 in the Software without restriction, including without limitation the rights
mbedalvaro 31:5f039cbddee8 8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
mbedalvaro 31:5f039cbddee8 9 copies of the Software, and to permit persons to whom the Software is
mbedalvaro 31:5f039cbddee8 10 furnished to do so, subject to the following conditions:
mbedalvaro 31:5f039cbddee8 11
mbedalvaro 31:5f039cbddee8 12 The above copyright notice and this permission notice shall be included in
mbedalvaro 31:5f039cbddee8 13 all copies or substantial portions of the Software.
mbedalvaro 31:5f039cbddee8 14
mbedalvaro 31:5f039cbddee8 15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
mbedalvaro 31:5f039cbddee8 16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
mbedalvaro 31:5f039cbddee8 17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
mbedalvaro 31:5f039cbddee8 18 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
mbedalvaro 31:5f039cbddee8 19 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
mbedalvaro 31:5f039cbddee8 20 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
mbedalvaro 31:5f039cbddee8 21 THE SOFTWARE.
mbedalvaro 31:5f039cbddee8 22 */
mbedalvaro 31:5f039cbddee8 23
mbedalvaro 31:5f039cbddee8 24 #ifndef NET_H
mbedalvaro 31:5f039cbddee8 25 #define NET_H
mbedalvaro 31:5f039cbddee8 26
mbedalvaro 31:5f039cbddee8 27 class NetIf;
mbedalvaro 31:5f039cbddee8 28 class NetTcpSocket;
mbedalvaro 31:5f039cbddee8 29 class NetUdpSocket;
mbedalvaro 31:5f039cbddee8 30 class NetDnsRequest;
mbedalvaro 31:5f039cbddee8 31
mbedalvaro 31:5f039cbddee8 32 #include <list>
mbedalvaro 31:5f039cbddee8 33 using std::list;
mbedalvaro 31:5f039cbddee8 34
mbedalvaro 31:5f039cbddee8 35 /*
mbedalvaro 31:5f039cbddee8 36 #include "host.h"
mbedalvaro 31:5f039cbddee8 37 #include "ipaddr.h"
mbedalvaro 31:5f039cbddee8 38 #include "netservice.h"
mbedalvaro 31:5f039cbddee8 39 #include "if/net/netif.h"
mbedalvaro 31:5f039cbddee8 40 #include "if/net/nettcpsocket.h"
mbedalvaro 31:5f039cbddee8 41 #include "if/net/netudpsocket.h"
mbedalvaro 31:5f039cbddee8 42 #include "if/net/netdnsrequest.h"
mbedalvaro 31:5f039cbddee8 43 */
mbedalvaro 31:5f039cbddee8 44
mbedalvaro 31:5f039cbddee8 45 class Host;
mbedalvaro 31:5f039cbddee8 46 class NetIf;
mbedalvaro 31:5f039cbddee8 47 class NetTcpSocket;
mbedalvaro 31:5f039cbddee8 48 class NetUdpSocket;
mbedalvaro 31:5f039cbddee8 49 class NetDnsRequest;
mbedalvaro 31:5f039cbddee8 50
mbedalvaro 31:5f039cbddee8 51 class Net
mbedalvaro 31:5f039cbddee8 52 {
mbedalvaro 31:5f039cbddee8 53 private:
mbedalvaro 31:5f039cbddee8 54 Net();
mbedalvaro 31:5f039cbddee8 55 ~Net();
mbedalvaro 31:5f039cbddee8 56 public:
mbedalvaro 31:5f039cbddee8 57 static void poll(); //Poll every if & socket
mbedalvaro 31:5f039cbddee8 58
mbedalvaro 31:5f039cbddee8 59 static NetTcpSocket* tcpSocket(NetIf& netif);
mbedalvaro 31:5f039cbddee8 60 static NetTcpSocket* tcpSocket(); //Socket on default if
mbedalvaro 31:5f039cbddee8 61 static void releaseTcpSocket(NetTcpSocket* pNetTcpSocket);
mbedalvaro 31:5f039cbddee8 62
mbedalvaro 31:5f039cbddee8 63 static NetUdpSocket* udpSocket(NetIf& netif);
mbedalvaro 31:5f039cbddee8 64 static NetUdpSocket* udpSocket(); //Socket on default if
mbedalvaro 31:5f039cbddee8 65 static void releaseUdpSocket(NetUdpSocket* pNetUdpSocket);
mbedalvaro 31:5f039cbddee8 66
mbedalvaro 31:5f039cbddee8 67 static NetDnsRequest* dnsRequest(const char* hostname, NetIf& netif);
mbedalvaro 31:5f039cbddee8 68 static NetDnsRequest* dnsRequest(const char* hostname); //Create a new NetDnsRequest object from default if
mbedalvaro 31:5f039cbddee8 69
mbedalvaro 31:5f039cbddee8 70 static NetDnsRequest* dnsRequest(Host* pHost, NetIf& netif);
mbedalvaro 31:5f039cbddee8 71 static NetDnsRequest* dnsRequest(Host* pHost); //Create a new NetDnsRequest object from default if
mbedalvaro 31:5f039cbddee8 72
mbedalvaro 31:5f039cbddee8 73 static void setDefaultIf(NetIf& netif); //Deprecated
mbedalvaro 31:5f039cbddee8 74 static void setDefaultIf(NetIf* pIf);
mbedalvaro 31:5f039cbddee8 75 static NetIf* getDefaultIf();
mbedalvaro 31:5f039cbddee8 76
mbedalvaro 31:5f039cbddee8 77 protected:
mbedalvaro 31:5f039cbddee8 78 friend class NetIf;
mbedalvaro 31:5f039cbddee8 79 friend class NetTcpSocket;
mbedalvaro 31:5f039cbddee8 80 friend class NetUdpSocket;
mbedalvaro 31:5f039cbddee8 81
mbedalvaro 31:5f039cbddee8 82 static void registerIf(NetIf* pIf);
mbedalvaro 31:5f039cbddee8 83 static void unregisterIf(NetIf* pIf);
mbedalvaro 31:5f039cbddee8 84
mbedalvaro 31:5f039cbddee8 85 static void registerNetTcpSocket(NetTcpSocket* pNetTcpSocket);
mbedalvaro 31:5f039cbddee8 86 static void unregisterNetTcpSocket(NetTcpSocket* pNetTcpSocket);
mbedalvaro 31:5f039cbddee8 87
mbedalvaro 31:5f039cbddee8 88 static void registerNetUdpSocket(NetUdpSocket* pNetUdpSocket);
mbedalvaro 31:5f039cbddee8 89 static void unregisterNetUdpSocket(NetUdpSocket* pNetUdpSocket);
mbedalvaro 31:5f039cbddee8 90
mbedalvaro 31:5f039cbddee8 91 private:
mbedalvaro 31:5f039cbddee8 92 static Net& net(); //Return inst of singleton
mbedalvaro 31:5f039cbddee8 93
mbedalvaro 31:5f039cbddee8 94 NetIf* m_defaultIf;
mbedalvaro 31:5f039cbddee8 95
mbedalvaro 31:5f039cbddee8 96 list<NetIf*> m_lpIf;
mbedalvaro 31:5f039cbddee8 97 list<NetTcpSocket*> m_lpNetTcpSocket;
mbedalvaro 31:5f039cbddee8 98 list<NetUdpSocket*> m_lpNetUdpSocket;
mbedalvaro 31:5f039cbddee8 99 };
mbedalvaro 31:5f039cbddee8 100
mbedalvaro 31:5f039cbddee8 101 #endif